Last post Sep 25, 2010 10:47 AM by rLD-i.com
Sep 24, 2010 10:15 PM|rLD-i.com|LINK
document.getElementById("<%= errorText.ClientID %>").innerText = error;
And my C#:
textError = "This is not working!!!";
Even if i pass the string instead of the 'textError' variable i still get the same error :(
Can anyone help me?
Sep 24, 2010 11:07 PM|VB_Gone-Wild|LINK
and then call the function from codebehind. So something like this:
Code Behind C#:
StringBuilder sb = new StringBuilder();
sb.Append("displayMessage('" + textError + "');");
if (sb != null)
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), Guid.NewGuid().ToString(), sb.ToString(), true);
Obviously if all you wanted to do was put the message into an alert box all you had to do was put it in the stringbuilder to begind within instead of calling the function
sb.Append("alert('" + textError '");");
But I seperate this mainly becuase I normally want to do something additional with the script such as building a custom pop-up box, animating something or whatever. Also I use a stringbuilder becuase I normally want to do more than a one liner for my registered
script. Hopefully this helps some.
Sep 25, 2010 08:09 AM|rLD-i.com|LINK
Hi Gone-Wild! Thanks allot for the help.
I did what you said, and i still get the same error, [object Object] instead of the actual message :(
Why is this happening?
Sep 25, 2010 08:12 AM|namratam|LINK
Sep 25, 2010 10:47 AM|rLD-i.com|LINK
Once again thanks allot!