this is the function to show the message box if it is called. But when i put this 
function in the normal .aspx file, it work fine.But when i put it in the .cs (class) 
file, and call this function.it cant work..

 

public void ShowMessage(string message) 

{

String scriptString = "<script language=JavaScript>";

scriptString += "alert('" + message + "');";

scriptString += "</script>";

 Page.RegisterStartupScript("ShowMessage", scriptString);

} 

it come out the error :

The type or namespace name 'Page' could not be found (are you missing a using 
directive or an assembly reference?)


what happen actually?

 and when i change the red color coding to :

public void ShowMessage(string message) 

{

String scriptString = "<script language=JavaScript>";

scriptString += "alert('" + message + "');";

scriptString += "</script>";

 

System.Web.UI.Page pg=new System.Web.UI.Page();

pg.RegisterStartupScript("ShowMessage",scriptString); 

);

} 

it can compile without error but nothing come out when i call this function.What 
happen actually?

 

 


                
---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to