Wednesday, March 28, 2012
Troubble with links in emails
I was sure this was an issue with the mail client, but apparently many of our customers are experiencing the same problem. I haven't been able to reproduce this problem myself because all my email clients display the links properly, but I have had some of our clients forward the mails to me, and the dot is actually missing. (http://www.blablacom/Page.aspx).
Have any of you guys seen this problem before? And how can I solve it?Are you still using the Beta version??
Yes, this is beta 2. I haven't been able to test it on the final version yet, because I can't reproduce the problem myself and we haven't shipped the new version to our customers yet.
Do you think it will work differently in the final version?
This is an issue that I haven't heard of earlier. I suggest you download the RTM of the .Net Framework and install it (remember to uninstall any beta version before installing if you intend to do this on the same machine). If your problem remains, I suggest you check the original data and code for string manipulation methods which may cause dots to disappear.
We uninstalled Beta 2 and installed RTM. This solved the problem without any changes to the code.
Monday, March 26, 2012
Trouble programatically getting form values on PostBack
protected System.Web.UI.WebControls.RadioButtonList rblSymbols;
protected System.Web.UI.WebControls.CheckBox chkPublish;
protected System.Web.UI.WebControls.DropDownList ddlSubject;
protected System.Web.UI.WebControls.TextBox txtEntry;
protected System.Web.UI.WebControls.Button btnSave;
The btnSave_Click(object sender, System.EventArgs e) is properly registered in the InitializeComponent() method. Inside the btnSave_Click() method, I call another function to save to the db which works fine. However, when I attempt to reference the values of those items, they are not set properly. It's as if the IPostBackDataHandler.LoadPostData() method in the Init of the page lifecycle is not being done at all. Any ideas? So far, I have had to result to the following until this is figured out:
YUCK!:
**********************
myObj.Entry = Request["txtEntry"];
Preferred:
**********************
myObj.Entry = txtEntry.Text;
Thanks in advance for any insight you might have.
--ChadIs it possible you've disabled Viewstate at some point?
Peter,
Yes, itIS possible. In fact, I have done just that on several of my controls. Is this the problem? I will try re-enabling. I have read so much on the pros and cons of keeping it turned on. Is is safe to assume that if I wish to program as described above, I need to keep viewstate enabled?
--Chad
Heh... yeah, that could be the problem :)
ViewState is the mechanism by which your controls' properties are persisted across postbacks. If you want to grab myControl.Text, for example, you must have Viewstate enabled.
On the other hand, if you don't mind grabbing values from the Request.Form collection, you can kill Viewstate with impunity.
Cheers,
Peter - thanks for clearing this up for me! Very helpful!
--Chad
Saturday, March 24, 2012
Trouble understanding relationship between .Net SMTP and IIS SMTP
I have read some FAQs on System.net.mail but I have not seen a clear explaination of how to set up the email to hit a remote server
We use Godaddy.com for our Email so I want to log on and delivery my outgoing email to them.
Both IIS and .Net allow me to specify server settings - so how should I do this?
1. Tell .net in web.config that my server is "localhost" and then configure IIS SMPT to log onto Godaddy?
2. Tell .Net in Web.Config that my server is the Godaddy server and log on directly from there, bypassing IIS?
IIS SMPT is called a "virtual server" - does that mean it needs to hit a "real" server or can it be used to send real email directly?
if #1 above, should I use the IIS pickup directory or not?
Thanks
Bill
Remove SMTP from IIS. You don't need it for system.net.mail, you just need a SMTP server somewhere that you can send your mail through.
Now, configure system.net.mail, in web.config or elsewhere, to send through the GoDaddy server with the login/password fo your account. Seewww.systemnetmail.com for help on the coding.
Jeff
Thanks,
Perhaps that first sentence should be in the Faq's since I read plenty about using Localhost or 127.0.0.1 which suggesed to me that IIS was necessary.
Bill
Back in the NT4 days with CDONTS, a local SMTP server was required. IIS ships with a SMTP server, so it's always a possibility. But the only real requirement is a SMTP server somewhere that can be reached by the code. Of course, tha can still be Localhost, though if you're on a broadband connection or a dynamic IP many SMTP servers will refuse transactions with you, since the "hobbyist" servers are more likely to be compromised and sending SPAM.
Jeff
trouble with DataReader
I'm trying to use a DataReader but I get an error.
This is my code:
private void Page_Load(object sender, System.EventArgs e)
{
SqlConnection oCon = new SqlConnection("server=server;uid=id;" +
"pwd=pwd;database=database");
SqlCommand oCmd = new SqlCommand("SELECT nieuwsid, datum, titel FROM news
WHERE datum <= { fn CURDATE() })ORDER BY datum DESC",oCon);
oCon.Open();
oCmd.Connection=oCon;
SqlDataReader dr = oCmd.ExecuteReader();
oCmd.Dispose ();
oCon.Close();
oCon.Dispose();
}
I have an error at runtime on the line SqlDataReader dr =
oCmd.ExecuteReader();
The error is: Incorrect syntax near ')'.
With I simply delete the line with the error then I don't get an error, so I
think the error is in the line SqlDataReader dr = oCmd.ExecuteReader();
Can someone say what I do wrong ?
grz
Bernie V
--
http://www.djberniev.beI think you query syntax is off. Try running it in query analyzer and fix
it.
"Bernie V" <bernd.vantyghem@.pandoradotbe> wrote in message
news:uXVuK8K8DHA.2924@.tk2msftngp13.phx.gbl...
> Hi group,
> I'm trying to use a DataReader but I get an error.
> This is my code:
> private void Page_Load(object sender, System.EventArgs e)
> {
> SqlConnection oCon = new SqlConnection("server=server;uid=id;" +
> "pwd=pwd;database=database");
> SqlCommand oCmd = new SqlCommand("SELECT nieuwsid, datum, titel FROM news
> WHERE datum <= { fn CURDATE() })ORDER BY datum DESC",oCon);
> oCon.Open();
> oCmd.Connection=oCon;
> SqlDataReader dr = oCmd.ExecuteReader();
> oCmd.Dispose ();
> oCon.Close();
> oCon.Dispose();
> }
> I have an error at runtime on the line SqlDataReader dr =
> oCmd.ExecuteReader();
> The error is: Incorrect syntax near ')'.
> With I simply delete the line with the error then I don't get an error, so
I
> think the error is in the line SqlDataReader dr = oCmd.ExecuteReader();
> Can someone say what I do wrong ?
> grz
> Bernie V
>
> --
> http://www.djberniev.be
"Marina" <someone@.nospam.com> schreef in bericht
news:umi3Y$K8DHA.2064@.TK2MSFTNGP11.phx.gbl...
> I think you query syntax is off. Try running it in query analyzer and fix
> it.
Hi Marina,
This was also my first opinion. But I changed the query to a simple select
query and I had the same problem.
The query like I use works in the query analyser.
grz
Bernie V
--
http://www.djberniev.be
The error message indicates a syntax problem with the query. I would suggest
either putting a breakpoint in, or recording the generated query somewhere
so that you can copy the generated query string and run it in Query Analyzer
to find out the problem with it.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Bernie V" <bernd.vantyghem@.pandoradotbe> wrote in message
news:#YfjfNL8DHA.1504@.TK2MSFTNGP12.phx.gbl...
> "Marina" <someone@.nospam.com> schreef in bericht
> news:umi3Y$K8DHA.2064@.TK2MSFTNGP11.phx.gbl...
> > I think you query syntax is off. Try running it in query analyzer and
fix
> > it.
> Hi Marina,
> This was also my first opinion. But I changed the query to a simple select
> query and I had the same problem.
> The query like I use works in the query analyser.
> grz
> Bernie V
> --
> http://www.djberniev.be
"Marina" <someone@.nospam.com> schreef in bericht
news:umi3Y$K8DHA.2064@.TK2MSFTNGP11.phx.gbl...
> I think you query syntax is off. Try running it in query analyzer and fix
> it.
Marina,
I double cheked and you 're right !
There where to many ')' .
Thx !
grz
Bernie V
Looks like you dont have a corresponding '('
Bernie V wrote:
> Hi group,
> I'm trying to use a DataReader but I get an error.
> This is my code:
> private void Page_Load(object sender, System.EventArgs e)
> {
> SqlConnection oCon = new SqlConnection("server=server;uid=id;" +
> "pwd=pwd;database=database");
> SqlCommand oCmd = new SqlCommand("SELECT nieuwsid, datum, titel FROM news
> WHERE datum <= { fn CURDATE() })ORDER BY datum DESC",oCon);
> oCon.Open();
> oCmd.Connection=oCon;
> SqlDataReader dr = oCmd.ExecuteReader();
> oCmd.Dispose ();
> oCon.Close();
> oCon.Dispose();
> }
> I have an error at runtime on the line SqlDataReader dr =
> oCmd.ExecuteReader();
> The error is: Incorrect syntax near ')'.
> With I simply delete the line with the error then I don't get an error, so I
> think the error is in the line SqlDataReader dr = oCmd.ExecuteReader();
> Can someone say what I do wrong ?
> grz
> Bernie V
--
Regards,
Dilip Krishnan
dilipkrish at msn. com
Thursday, March 22, 2012
trouble with image
I'm a beginner of asp.net:( When I click a
(System.Web.UI.WebControls.)Button on a page,of course,its' click event has
been assigned,the images on this page should be refreshed,right?These
images' imageurl are such as "getpic.aspx?id=xxx".But refresh doesn't
happen,why?
Much thanx.Presumably because the browser has cached the image that was at that
URL previously. If you want to load a different image for each screen
refresh then add a random number, or datestamp to the URL for your
image, that way the browser receives a different URL and will
redownload the image.
"Flinky Wisty Pomm" <Pathogenix@.gmail.com> wrote in message
news:1144079199.958679.87150@.v46g2000cwv.googlegroups.com...
> Presumably because the browser has cached the image that was at that
> URL previously. If you want to load a different image for each screen
> refresh then add a random number, or datestamp to the URL for your
> image, that way the browser receives a different URL and will
> redownload the image.
>
For a production environment, where the image may not change much, then I
would recommend removing the auto-generated number so that the cache
displays the image. Otherwise, the client may download more than it needs
too...<shrug>
Mythran
Thanx for your advice.My current problem: in the button click event,picture
stored in db is changed. "GetPic.aspx?id=xxx" is used to get pic from
db.What I want is after click,the image on this page should display the new
content(reload from db).But now db has updated successfully,the page is
still here,no change.
"Flinky Wisty Pomm" <Pathogenix@.gmail.com>
':1144079199.958679.87150@.v46g2000cwv.googlegroups.com...
> Presumably because the browser has cached the image that was at that
> URL previously. If you want to load a different image for each screen
> refresh then add a random number, or datestamp to the URL for your
> image, that way the browser receives a different URL and will
> redownload the image.
>
"removing the auto-generated number so that the cache displays the image"
Sorry but I have no idea how to remove,thanx.
"Mythran" <kip_potter@.hotmail.comREMOVETRAIL>
':eeIMsezVGHA.5044@.TK2MSFTNGP09.phx.gbl...
> "Flinky Wisty Pomm" <Pathogenix@.gmail.com> wrote in message
> news:1144079199.958679.87150@.v46g2000cwv.googlegroups.com...
> For a production environment, where the image may not change much, then I
> would recommend removing the auto-generated number so that the cache
> displays the image. Otherwise, the client may download more than it needs
> too...<shrug>
> Mythran
>
Much thanx,Flinky Wisty Pomm && Mythran:)
I got it,add a RequiredFieldValidator on the page and bind it to any
control,then nothing bother me:) But who can tell me why?puzzling
"tjer" <tj@.tj.edu.cn> д?:#jIoo1xVGHA.5288@.TK2MSFTNGP14.phx.gbl...
> Hi guys,
> I'm a beginner of asp.net:( When I click a
> (System.Web.UI.WebControls.)Button on a page,of course,its' click event
has
> been assigned,the images on this page should be refreshed,right?These
> images' imageurl are such as "getpic.aspx?id=xxx".But refresh doesn't
> happen,why?
> Much thanx.
>
trouble with image
I'm a beginner of asp.net:( When I click a
(System.Web.UI.WebControls.)Button on a page,of course,its' click event has
been assigned,the images on this page should be refreshed,right?These
images' imageurl are such as "getpic.aspx?id=xxx".But refresh doesn't
happen,why?
Much thanx.Presumably because the browser has cached the image that was at that
URL previously. If you want to load a different image for each screen
refresh then add a random number, or datestamp to the URL for your
image, that way the browser receives a different URL and will
redownload the image.
"Flinky Wisty Pomm" <Pathogenix@.gmail.com> wrote in message
news:1144079199.958679.87150@.v46g2000cwv.googlegro ups.com...
> Presumably because the browser has cached the image that was at that
> URL previously. If you want to load a different image for each screen
> refresh then add a random number, or datestamp to the URL for your
> image, that way the browser receives a different URL and will
> redownload the image.
For a production environment, where the image may not change much, then I
would recommend removing the auto-generated number so that the cache
displays the image. Otherwise, the client may download more than it needs
too...<shrug
Mythran
Thanx for your advice.My current problem: in the button click event,picture
stored in db is changed. "GetPic.aspx?id=xxx" is used to get pic from
db.What I want is after click,the image on this page should display the new
content(reload from db).But now db has updated successfully,the page is
still here,no change.
"Flinky Wisty Pomm" <Pathogenix@.gmail.com>
??:1144079199.958679.87150@.v46g2000cwv.googleg roups.com...
> Presumably because the browser has cached the image that was at that
> URL previously. If you want to load a different image for each screen
> refresh then add a random number, or datestamp to the URL for your
> image, that way the browser receives a different URL and will
> redownload the image.
"removing the auto-generated number so that the cache displays the image"
Sorry but I have no idea how to remove,thanx.
"Mythran" <kip_potter@.hotmail.comREMOVETRAIL>
??:eeIMsezVGHA.5044@.TK2MSFTNGP09.phx.gbl...
> "Flinky Wisty Pomm" <Pathogenix@.gmail.com> wrote in message
> news:1144079199.958679.87150@.v46g2000cwv.googlegro ups.com...
> > Presumably because the browser has cached the image that was at that
> > URL previously. If you want to load a different image for each screen
> > refresh then add a random number, or datestamp to the URL for your
> > image, that way the browser receives a different URL and will
> > redownload the image.
> For a production environment, where the image may not change much, then I
> would recommend removing the auto-generated number so that the cache
> displays the image. Otherwise, the client may download more than it needs
> too...<shrug>
> Mythran
Much thanx,Flinky Wisty Pomm && Mythran:)
I got it,add a RequiredFieldValidator on the page and bind it to any
control,then nothing bother me:) But who can tell me why?puzzling
"tjer" <tj@.tj.edu.cn> д?:#jIoo1xVGHA.5288@.TK2MSFTNGP14.phx.gbl ...
> Hi guys,
> I'm a beginner of asp.net:( When I click a
> (System.Web.UI.WebControls.)Button on a page,of course,its' click event
has
> been assigned,the images on this page should be refreshed,right?These
> images' imageurl are such as "getpic.aspx?id=xxx".But refresh doesn't
> happen,why?
> Much thanx.
Tuesday, March 13, 2012
Troubleshooting asp.net on XP Pro
I know it's not my code because the files will work if I move them to my company's web server (Shhh, don't tell).
I set up IIS and made a virtual directory that points to a partition where I'm putting the files.
I have the .NET Framework 1.1 and ran a windows update today.
Here is an example of a problem. This For...Next statement is supposed to write a sentence 7 times in different sizes. If I load the page in my browser it displays:
> Hello and Welcome!
Here is my code:
1. run aspnet_regiis.exe
<%@dotnet.itags.org.Page Language="VB" Debug="True" %>
<html>
<head>
<title>Hello and Welcome Page</title>
</head>
<body>
<center>
<% Dim TextSize As Integer %>
<% For TextSize = 1 To 7 %>
<font size = <%=TextSize%>>
Hello and Welcome!<br>
</font>
<% Next %>
</center>
</body>
</html
2. make sure you're requesting the page via HTTP and not just from the filesystem.
When I try to run Aspnet_regiis.exe I get an error message:
The application Failed to initialize properly. (0xc0000142)
Wonder if this is my problem?
Oh, I see I have to run that command from a Visual Studio command prompt. I will try that.
aspnet_regiis.exe -i fixed the problem!
Did you tried with -i ?