Re: Dynamic Alert/MessageBox
Edit
Dude, not a good idea.
Response.Write is not a good thing to use on ASP.NET pages.
Re: Dynamic Alert/MessageBox
Then how would you recomend invoking a alert without having to use a hidden control or something?
Say if you wanted to evaluate a couple of aspx controls and depending on the scenerio, call a message?
Re: Dynamic Alert/MessageBox
Quote:
Originally Posted by RobDog888
Then how would you recomend invoking a alert without having to use a hidden control or something?
Say if you wanted to evaluate a couple of aspx controls and depending on the scenerio, call a message?
By using Page.RegisterStartupScript.
Re: Dynamic Alert/MessageBox
Yes, I learned that one a while ago as it was a question froggy couldnt answer when I was just starting to learn asp.net. :D
Re: Dynamic Alert/MessageBox
Quote:
Originally Posted by mendhak
Edit
Dude, not a good idea.
Response.Write is not a good thing to use on ASP.NET pages.
then what else do u use to display anything on the page from the code-behind?
Re: Dynamic Alert/MessageBox
Hes means to use other methods like - Me.Page.RegisterStartupScript(...
or ...
Me.Page.RegisterClientScriptBlock(...
Re: Dynamic Alert/MessageBox
ahh ok, so for registering javascripts...
not exactly just trying to display Hello, World! on the page..
Cool, thanks for clearing that up
Re: Dynamic Alert/MessageBox
VB Code:
Me.Page.RegisterStartupScript("script1", "<script language='JavaScript' type='text/javascript'>alert('Hello World');</script>")
No need for js in the html. :)