c# - How to use Message Box in asp.net -


I am trying to show a message box to the user where the message box can either choose yes or no; If they choose yes then I want to call some functions and if they do not choose any one, I want to call any other function. This is not what's in my code now. Please help me here. My code is:

  Protected Zero Test () {string ID = ddlPr.SelectedValue; String PRACTICE_TYPE = DDL_TYPE.SelectedValue; (Using SqlConnection con = new SqlConnection (strConnString)) (SqlCommand cmd = new SqlCommand ()) {cmd.Connection = con; Cmd.CommandType = CommandType.Text; Cmd.CommandText = "Selection Number (*) from [DA2]. [QPMS]. [QPMS_RESPONSE] where id = @ id"; Cmd.Parameters.AddWithValue ("@ ID", ID); Con.Open (); Int result = (int) cmd.ExecuteScalar (); If (result & gt; = 1) {// If the user chooses, I want to call some functions if I select the user, then I want to call any other function. String myscript = "alert ('message');"; Page Client script. Registrar ClientBlock (This Gate Type), "MyScript", MyScript, True); } Con.Close (); }}}}  

I use all the web applications at this time, I One static way I can call one of the 2 overloaded methods, it works 100%. I have just tested to confirm

  public static void ShowClientMessageDlg (string msg, string aValue, string redirect = "") {string msgFormat; MsgFormat = string.Format ("{0}", avv); Msg = msg + msgFormat; HttpContext.Current.Response.Write ("script type = 'text / javascript' & gt; warning ('" + msg + "'); "); } /// & lt; Summary & gt; /// contains a string of values ​​for creating message boxes /// & lt; / Summary & gt; /// & lt; Param name = "msg" & gt; & Lt; / Param & gt; /// & lt; Ultimate name = "Ave" & gt; & Lt; / Param & gt; /// & lt; Param name = "redirect" & gt; & Lt; / Param & gt; Public Static Zero ShowClientMessageDlg (string msg, list & lt; string & gt; aValue, string directory = "") {string msgFormat; MsgFormat = string.Format ("{0}", add string> add string to & lt; string & gt; (",", aValue.ToArray ()); Msg = msg + msgFormat; HttpContext.Current.Response.Write ("script type = 'text / javascript' & gt; warning ('" + msg + "'); "); }  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -