Click here to Skip to main content
15,915,094 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: how to avoid postback on button click event in asp.net/javascript? Pin
dreddy74-Sep-07 9:49
dreddy74-Sep-07 9:49 
GeneralRe: how to avoid postback on button click event in asp.net/javascript? Pin
Christian Graus4-Sep-07 10:21
protectorChristian Graus4-Sep-07 10:21 
GeneralRe: how to avoid postback on button click event in asp.net/javascript? Pin
dreddy74-Sep-07 11:26
dreddy74-Sep-07 11:26 
GeneralRe: how to avoid postback on button click event in asp.net/javascript? Pin
Christian Graus4-Sep-07 11:29
protectorChristian Graus4-Sep-07 11:29 
GeneralRe: how to avoid postback on button click event in asp.net/javascript? Pin
ChrisKo4-Sep-07 12:08
ChrisKo4-Sep-07 12:08 
GeneralRe: how to avoid postback on button click event in asp.net/javascript? Pin
Christian Graus4-Sep-07 14:59
protectorChristian Graus4-Sep-07 14:59 
GeneralRe: how to avoid postback on button click event in asp.net/javascript? Pin
Lucky Sheikh5-Sep-07 0:36
Lucky Sheikh5-Sep-07 0:36 
GeneralRe: how to avoid postback on button click event in asp.net/javascript? Pin
dreddy75-Sep-07 4:25
dreddy75-Sep-07 4:25 
isPostBack is a readonly property right? so I am not able to do that.

And actually I am using master page and content pages in my project. One of my content page has a table which needs to be printed on print button click. I have used asp:button control for this.

And in my print_click event in vb, i have written the code like this:
<br />
<br />
Protected Sub btnPrint_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrint.Click<br />
<br />
            Dim printScript As String = "<script language='javascript'>" & _<br />
            "var foo = document.getElementById( 'plansheet' ); var bar = open('about:blank', 'myPopup', 'print'); bar.document.body.innerHTML = foo.innerHTML; bar.print();</script>"<br />
<br />
            ClientScript.RegisterStartupScript(Me.GetType(), "PrintScript", printScript.ToString())<br />
           <br />
<br />
    End Sub


The 'plansheet' is the id of my html table. This code opens a separate blank page with table alone in it and pops up the print dialog.
When i use/cancel print in this dialog and go back to the original page and when i click F5 or refresh, the print is getting triggered once again and is openeing up the blankpage and printdialog once again.

Hope I am clear in explaining my scenario.

Thank you
GeneralRe: how to avoid postback on button click event in asp.net/javascript? Pin
dreddy75-Sep-07 4:51
dreddy75-Sep-07 4:51 
GeneralRe: how to avoid postback on button click event in asp.net/javascript? Pin
Lucky Sheikh5-Sep-07 18:35
Lucky Sheikh5-Sep-07 18:35 
QuestionExtending the delete/edit buttons in gridview Pin
kumswa4-Sep-07 7:59
kumswa4-Sep-07 7:59 
AnswerRe: Extending the delete/edit buttons in gridview Pin
Christian Graus4-Sep-07 8:16
protectorChristian Graus4-Sep-07 8:16 
QuestionViewState Problem Pin
RoyRose784-Sep-07 6:41
RoyRose784-Sep-07 6:41 
AnswerRe: ViewState Problem Pin
Christian Graus4-Sep-07 6:56
protectorChristian Graus4-Sep-07 6:56 
GeneralRe: ViewState Problem Pin
RoyRose784-Sep-07 8:16
RoyRose784-Sep-07 8:16 
GeneralRe: ViewState Problem Pin
Christian Graus4-Sep-07 8:29
protectorChristian Graus4-Sep-07 8:29 
Questione-commerce functionality ASP.NET shopping carts Pin
SAS254-Sep-07 6:19
SAS254-Sep-07 6:19 
AnswerRe: e-commerce functionality ASP.NET shopping carts Pin
Lucky Sheikh5-Sep-07 0:34
Lucky Sheikh5-Sep-07 0:34 
QuestionSSO and Debugging on XP Pro - domain issues Pin
davidhart4-Sep-07 6:06
davidhart4-Sep-07 6:06 
Questionhow can i show a pdf file in asp.net ? Pin
B.A4-Sep-07 5:52
B.A4-Sep-07 5:52 
AnswerRe: how can i show a pdf file in asp.net ? Pin
Christian Graus4-Sep-07 6:01
protectorChristian Graus4-Sep-07 6:01 
GeneralRe: how can i show a pdf file in asp.net ? Pin
B.A4-Sep-07 6:17
B.A4-Sep-07 6:17 
GeneralRe: how can i show a pdf file in asp.net ? Pin
Christian Graus4-Sep-07 6:33
protectorChristian Graus4-Sep-07 6:33 
GeneralRe: how can i show a pdf file in asp.net ? Pin
B.A4-Sep-07 20:31
B.A4-Sep-07 20:31 
AnswerRe: how can i show a pdf file in asp.net ? Pin
Lucky Sheikh5-Sep-07 1:02
Lucky Sheikh5-Sep-07 1:02 

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.