c# - How can the program structure reach Page_PreRender in a page of asp.net -


i have asp page have 2 grid in have remark textbox , delete button in each row. when remark textbox empty run serverside validation this:

  {     if (remarktextbox.text == string.empty)             {                 brmessengers.brinformation(this, "remarks cannot left empty.");                 return;             }             else             {                if (session["update"].tostring() == viewstate["update"].tostring())                 {                     deletereport(id);                 }            }} 

my problem when run page executes well. when delete row without giving remark should give message here dont message also. , not program control flow doesnot reach page_prerender. in grid have same structure mentioned above runs well. have page_prerender function , sample follows:

    {        protected void page_prerender(object obj, eventargs e)      {         viewstate["update"] = session["update"];      }   } 

how can solve please give me solution. means lot me.

thank you, regard

bind grid in block. binding of grid create problem. therefore, should bind grid follows:

  {    try    {     if (remarktextbox.text == string.empty)     {         brmessengers.brinformation(this, "remarks cannot left empty.");         return;     }     else     {        if (session["update"].tostring() == viewstate["update"].tostring())         {             deletereport(id);         }    } } catch(exception) {  brmessanger.brmessage(this,"server error. please try again"); } {   yourgridname.datasource=loaddetails();   yourgridname.databind(); }  } 

hope solve problem.


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -