kdeutsch
asked on
Link button not responsing to single click
I had to turn a link button from a hyperlink button becuase of the way i load a page it did not like the pre-render of the hyperlink, I turned it to a link button so that i can still pass values but it takes 2 clicks of the link button for it to work. Then if I am on a pge and someone passes vlues to the link button and exports data and then they go back and pass another set of data, they agian have to click on it twice to get correct data. I am just trying to pop-up another page and send session state to it to export to excel. What am I doing wrong.
Protected Sub lnkExport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkExport.Click
Dim Type As Integer = 4
Dim DepID As Integer = ddlDeployment.SelectedValue
Dim BnID As String = ddlBn.SelectedValue
Dim UICId As Integer
Dim Cat As Integer
Dim task As Integer
Dim Pick As Integer = rbPick.SelectedValue
If ddlUic.SelectedValue = Nothing Then
UICId = 0
Else
UICId = ddlUic.SelectedValue
End If
If ddlCategory.SelectedValue = Nothing Then
Cat = 0
Else
Cat = ddlCategory.SelectedValue
End If
If ddlTask.SelectedValue = Nothing Then
task = 0
Else
task = ddlTask.SelectedValue
End If
If Pick = 0 Then
Session("Type") = Type
Session("SSN") = HFID.Value.ToString
Session("Cat") = Cat
Session("task") = task
Else
Session("Type") = Type
Session("Pick") = Pick
Session("DepID") = DepID
Session("BnID") = BnID
Session("UICId") = UICId
Session("Cat") = Cat
Session("task") = task
End If
lnkExport.Attributes.Add("onclick", "window.open('ExcelExport.aspx')")
End Sub
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
All,
OkNiether solution is working for me .
For Codecruiser I get a blue underline under teh Me (value of reports_taskManage cannot be converted to system type)
hainKurt
Response.write will not work for me as it is in an update panel
OkNiether solution is working for me .
For Codecruiser I get a blue underline under teh Me (value of reports_taskManage cannot be converted to system type)
hainKurt
Response.write will not work for me as it is in an update panel
Is this all in a page? Me should translate to Page
ASKER
CodeCruiser:
Ok see what you mean by it should be somewhere else, I changed it to my my on page load event and it works on single click now.
Ok see what you mean by it should be somewhere else, I changed it to my my on page load event and it works on single click now.
try this
var prm = Sys.WebForms.PageRequestMa nager.getI nstance();
prm.add_pageLoaded(pageLoa ded);
function pageLoaded(sender, args){
window.open('ExcelExport.a spx');
}
and comment out line 43
var prm = Sys.WebForms.PageRequestMa
prm.add_pageLoaded(pageLoa
function pageLoaded(sender, args){
window.open('ExcelExport.a
}
and comment out line 43
ASKER
CodeCruiser:,
The page is within a masterPage format, so that might be the reason it did not work, I have had so much trouble using master pages, when it comes up using javscript events and exports.
The page is within a masterPage format, so that might be the reason it did not work, I have had so much trouble using master pages, when it comes up using javscript events and exports.
it works on single click, but at the same time your server code works :)
so you open ExcelExport.aspx without running server code, without setting your session variables... this is not what you want...
probably in ExcelExport.aspx you are using those session variables, and this way they are not set yet...
this comment is for post 37065977
so you open ExcelExport.aspx without running server code, without setting your session variables... this is not what you want...
probably in ExcelExport.aspx you are using those session variables, and this way they are not set yet...
this comment is for post 37065977
ASKER
HainKurt:,
Don't like to use session variables and this is reason why, but I need to transfer sensitive data and don't wnat o do it thorugh the URl and get post will not work, I tired classes but sometimes they do not get iniliazed fro some reason. But I need to find a new solution becuase when our server is slow the session varialbes seem not to work. I need to figure out how to export to excel in a page that uses a master page in update panels. So far I have olny had lots of problems and errors. I am trying to encrypt URl right now and it works except for one little stinking number it doe snto like. So if you have any advice, I'll take it.
Don't like to use session variables and this is reason why, but I need to transfer sensitive data and don't wnat o do it thorugh the URl and get post will not work, I tired classes but sometimes they do not get iniliazed fro some reason. But I need to find a new solution becuase when our server is slow the session varialbes seem not to work. I need to figure out how to export to excel in a page that uses a master page in update panels. So far I have olny had lots of problems and errors. I am trying to encrypt URl right now and it works except for one little stinking number it doe snto like. So if you have any advice, I'll take it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for the help
lnkExport.Attributes.Add("
-->
response.write("<script>wi