Server Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have problem with my studio net 2003. My web Form content a textboox and button. I want each time click button an
textbox is empty, the message will appear suc

Button Click...procedur
IF Textbox.text="" The
msgBox("textbox must be filled...",......
...
ENDI
End Button...procedu

Everytime I run the form and click the button with the empty textbox, the server error message appears such as

"It is invalid to show a modal dialog or form when the application is not running in user interactive mode..

"Specify the service notification or default desktop only style to display notification from s service application

Is there anybody Would like to help me please? I Thank 4 your kind..
 
It is probably not possible to display an error message in the server side code. Instead the same can be achieved using javascript as
'Server side code
Private sub Page_load(.....
Button1.attributes.add("onClick","return fnCheckEmpty()")
end sub
'javascript code
function fnCheckEmpty()
{
if (document.forms[0].TextBox1.value == ""){
alert("Textbox should not be empty");
return false;}
else
return true;
}
hope this helps!
srini
 
is it web app? you should use RegisterStartupscript to show the message.

RegisterStartupScript("UniqueIDMessage","<script
language='javascript'>alert('message');</script>");

Av.
 
sRIni, thank 4 your answer, but I don't understand what do you mean. I think it should be possible, cause ASP.NET make it possible..but thank..
 
Back
Top