-----------------------------------------------------------

New Message on cochindotnet

-----------------------------------------------------------
From: mathewphilipp
Message 2 in Discussion

 

Hello Ansaf,

 

Hope this Code May Solve your Problem.. Try it out..!!!!!!

 

 

using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page 

{

protected void Page_Load(object sender, EventArgs e)

{

 

}

protected void Button1_Click(object sender, EventArgs e)

{

/*

* SET Session["SUCCESS"] = "True" IF YOUR DATA INSERTED IN THE TABLE ,

* ELSE SET Session["SUCCESS"] = "False";

*/

Session["SUCCESS"] = "True";

ShowMessageBox();

}

/// <summary>

/// Method to Show Message box according to your condition

/// </summary>

public void ShowMessageBox()

{

if (Session["SUCCESS"] != null)

{

if (Convert.ToString(Session["SUCCESS"]) == "True")

{

Response.Write("<script language = 'javascript'>window.alert('Submitted 
Successfully !')</script>");

}

else if (Convert.ToString(Session["SUCCESS"]) == "False")

{

Response.Write("<script language = 'javascript'>window.alert('Unable to Submit 
Now !')</script>");

}

Session["SUCCESS"] = null;

}

}

}




Regards

 

Mathew Philip :)






To: cochindotnet@groups.msn.com
From: [EMAIL PROTECTED]
Subject: Javascript from Codebehind(ASP.Net) using C#
Date: Sat, 26 Jul 2008 06:02:53 -0700


<META content="Microsoft SafeHTML" name=Generator>
<STYLE>
ExternalClass EC_ThmFgColumnHeader, .ExternalClass A.EC_FrameLink, 
ExternalClass A.EC_HeaderLink, .ExternalClass A.EC_FooterLink, ExternalClass 
A.EC_LgtCmd, .ExternalClass A.EC_MSNLink
{color:#FFFFFF;}
ExternalClass EC_ThmFgTitleLightBk
{color:#FF6600;}
ExternalClass EC_ThmFgSmallLight
{color:#ff0000;}
ExternalClass EC_ThmFgNavLink, .ExternalClass A.EC_NavLink, ExternalClass 
A.EC_ChildLink:hover
{color:#666699;}
ExternalClass EC_ThmFgInactiveText, .ExternalClass A.EC_SystemLink
{color:#666666;}
ExternalClass EC_ThmFgFrameTitle
{color:#FFFFCC;}
ExternalClass EC_ThmFgTitleDarkBk, .ExternalClass A.EC_NavLink:hover, 
ExternalClass A.EC_TitleLink
{color:#CC6600;}
ExternalClass EC_ThmFgMiscText, .ExternalClass A.EC_Cat, .ExternalClass 
A.EC_SubCat
{color:#336699;}
ExternalClass EC_ThmFgCommand, .ExternalClass A.EC_Command, ExternalClass 
A.EC_LargeCommand, .ExternalClass A.EC_MsgLink
{color:#003366;}
ExternalClass EC_ThmFgHeader
{color:#333333;}
ExternalClass EC_ThmFgStandard, .ExternalClass A.EC_SystemLink:hover, 
ExternalClass A.EC_SubLink, .ExternalClass A.EC_ChildLink, ExternalClass 
A.EC_StdLink, .ExternalClass SELECT.EC_Standard
{color:#000000;}
ExternalClass EC_ThmFgDivider
{color:#CCCCCC;}
ExternalClass EC_ThmBgStandard
{background-color:#FFFFFF;}
ExternalClass EC_ThmBgUnknown1
{background-color:#FF6600;}
ExternalClass EC_ThmBgFraming
{background-color:#666699;}
ExternalClass EC_ThmBgUnknown2
{background-color:#666666;}
ExternalClass EC_ThmBgHighlightDark
{background-color:#FFFFCC;}
ExternalClass EC_ThmBgHighlightLight, .ExternalClass #EC_idToolbar, 
ExternalClass #EC_tbContents
{background-color:#FFFFE8;}
ExternalClass EC_ThmBgTitleDarkBk
{background-color:#F1F1F1;}
ExternalClass EC_ThmBgAlternate
{background-color:#ECF1F6;}
ExternalClass EC_ThmBgUnknown3
{background-color:#CCCCFF;}
ExternalClass EC_ThmBgDivider
{background-color:#CCCCCC;}
ExternalClass EC_ThmBgHeader
{background-color:#9999CC;}
ExternalClass EC_ThmBgLinks
{background-color:#8696C9;}
ExternalClass EC_ThmBgSharkBar
{background-color:#8696C9;}
ExternalClass EC_ThmBgGlobalNick
{background-color:#9394A9;}
ExternalClass EC_calfgndcolor
{color:#E00505;}
ExternalClass EC_calbgndcolor
{color:#E00505;}
</STYLE>
 





New Message on cochindotnet



Javascript from Codebehind(ASP.Net) using C#





Reply





 
Reply to Sender   Recommend 
Message 1 in Discussion 





From: Ansaf 



Hello all

Hope things are fine there. Same here :-)

Could you please tell me how to add javascript in the code behind? 
ie, I have an asp:Button in my web form, onclick event will submit the values 
to table. I want to show message box saying failed or success according to the 
value passed from server.
I have true value bouncing from server for success and false value for failure 
successfully. 
Now I have to show a message box. 

Could you please tell me a solution.

Hope to hear from you soon.

Regards

-- 
Ansaf Mohammedali

View other groups in this category. 









To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings. 

Need help? If you've forgotten your password, please go to Passport Member 
Services. 
For other questions or feedback, go to our Contact Us page. 

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list. 
Remove my e-mail address from cochindotnet. 
Discover videos like never before. Search and explore on http://www.live.com/  
- video search by MSN. Try it!

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/cochindotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to