Click here to Skip to main content
15,888,610 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: i got error on gridview in allowPaging = true - asp.net Pin
Dhyanga19-Jan-11 10:03
Dhyanga19-Jan-11 10:03 
GeneralRe: i got error on gridview in allowPaging = true - asp.net Pin
goldsoft19-Jan-11 19:14
goldsoft19-Jan-11 19:14 
GeneralRe: i got error on gridview in allowPaging = true - asp.net Pin
TweakBird19-Jan-11 19:33
TweakBird19-Jan-11 19:33 
QuestionAny ASP.NET MVC open-source role management GUIs? Pin
Dimitri Witkowski18-Jan-11 21:34
Dimitri Witkowski18-Jan-11 21:34 
AnswerRe: Any ASP.NET MVC open-source role management GUIs? Pin
Sandeep Mewara22-Jan-11 8:36
mveSandeep Mewara22-Jan-11 8:36 
GeneralRe: Any ASP.NET MVC open-source role management GUIs? Pin
Dimitri Witkowski22-Jan-11 8:55
Dimitri Witkowski22-Jan-11 8:55 
QuestionJavascript Confirmation box not working from code behing Pin
meeram39518-Jan-11 21:21
meeram39518-Jan-11 21:21 
AnswerRe: Javascript Confirmation box not working from code behing Pin
Ankur\m/19-Jan-11 0:20
professionalAnkur\m/19-Jan-11 0:20 
I checked the page source and found that: if you enable AutoPostBack for a check box, an onclick handler is automatically attached to the page. Now when you add another onclick event to the page both of them are concatenated and looks like this -
XML
<input id="chkGenerateRpt" type="checkbox" name="chkGenerateRpt" onclick="javascript:return ReportConfirmation(); ;setTimeout('__doPostBack(\'chkGenerateRpt\',\'\')', 0)" /><label for="chkGenerateRpt">Generate Reports</label>


See the bold part. Thus it is not working.

Now how we can overcome this problem:

This thread describes the possible solutions -
http://www.dotnetmonster.com/Uwe/Forum.aspx/asp-net-web-controls/4449/Checkbox-AutoPostBack-JavaScript[^]

I will paste the solution here as well -

1. Manualy create a new checkBox class which derived from the asp.net's
CheckBox control and override the render method so as to insert our own
script before the build in "AutoPostBack" script (__doPostBack)

2. Use the InputCheckBox control in the System.Web.UI.HtmlControls
namespace and we can add a serverchange event for it and also handler its
clientside "onclick" script event. But we need to manually post back the
page when user click it at clientside, for example:

XML
<input type="checkbox" id="chkClient"  runat="server" value="..."
name="chkClient" onclick="alert('hello');document.forms[0].submit();"
onserverchange="chkServer_CheckedChanged">


in page's codebehind we have :

C#
protected void chkServer_CheckedChanged(object sender, System.EventArgs e)
{
    Response.Write("<br>CheckChanged at: " + DateTime.UtcNow.ToString());
}


I hope this clears your doubt and solves your issue! Thumbs Up | :thumbsup:

Cheers!
Ankur


..Go Green..

GeneralRe: Javascript Confirmation box not working from code behing Pin
meeram39519-Jan-11 13:49
meeram39519-Jan-11 13:49 
GeneralRe: Javascript Confirmation box not working from code behing Pin
Ankur\m/19-Jan-11 17:37
professionalAnkur\m/19-Jan-11 17:37 
Questiondr LUPP Pin
swaroops18-Jan-11 21:03
swaroops18-Jan-11 21:03 
AnswerRe: dr LUPP Pin
Manfred Rudolf Bihy19-Jan-11 9:49
professionalManfred Rudolf Bihy19-Jan-11 9:49 
Questioncustom datalist control Pin
Ersan Ercek18-Jan-11 10:01
Ersan Ercek18-Jan-11 10:01 
AnswerRe: custom datalist control Pin
thatraja18-Jan-11 14:42
professionalthatraja18-Jan-11 14:42 
GeneralRe: custom datalist control Pin
Ersan Ercek18-Jan-11 21:05
Ersan Ercek18-Jan-11 21:05 
AnswerRe: custom datalist control Pin
Yusuf18-Jan-11 15:07
Yusuf18-Jan-11 15:07 
GeneralRe: custom datalist control Pin
Ersan Ercek18-Jan-11 21:05
Ersan Ercek18-Jan-11 21:05 
Questionprevent Multiple users updating same record same time and same table Pin
vishnukamath16-Jan-11 19:09
vishnukamath16-Jan-11 19:09 
AnswerRe: prevent Multiple users updating same record same time and same table Pin
Pete O'Hanlon16-Jan-11 22:40
mvePete O'Hanlon16-Jan-11 22:40 
AnswerRe: prevent Multiple users updating same record same time and same table Pin
thatraja17-Jan-11 15:43
professionalthatraja17-Jan-11 15:43 
AnswerRe: prevent Multiple users updating same record same time and same table Pin
Dalek Dave4-Mar-11 13:25
professionalDalek Dave4-Mar-11 13:25 
QuestionWebsite is hacked sporadicaly ! Pin
devboycpp16-Jan-11 6:50
devboycpp16-Jan-11 6:50 
AnswerRe: Website is hacked sporadicaly ! Pin
luisnike1916-Jan-11 7:40
luisnike1916-Jan-11 7:40 
AnswerHow long is a piece of string? Pin
Keith Barrow16-Jan-11 8:23
professionalKeith Barrow16-Jan-11 8:23 
AnswerRe: Website is hacked sporadicaly ! Pin
Pete O'Hanlon16-Jan-11 9:36
mvePete O'Hanlon16-Jan-11 9:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.