We help IT Professionals succeed at work.
Get Started

Link button not responsing to single click

377 Views
Last Modified: 2012-05-12
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

Open in new window

Comment
Watch Question
Sr. System Analyst
Commented:
This problem has been solved!
Unlock 2 Answers and 11 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE