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

ASP.NET

 
GeneralReg Expression Pin
trilokharry23-Jan-08 22:51
trilokharry23-Jan-08 22:51 
GeneralRe: Reg Expression Pin
Paddy Boyd23-Jan-08 23:06
Paddy Boyd23-Jan-08 23:06 
GeneralRe: Reg Expression Pin
trilokharry23-Jan-08 23:18
trilokharry23-Jan-08 23:18 
GeneralRe: Reg Expression Pin
N a v a n e e t h23-Jan-08 23:35
N a v a n e e t h23-Jan-08 23:35 
GeneralRe: Reg Expression Pin
gethomast24-Jan-08 2:53
gethomast24-Jan-08 2:53 
Generalhello active serverssssssssssssss Pin
girmay23-Jan-08 22:45
girmay23-Jan-08 22:45 
GeneralRe: hello active serverssssssssssssss Pin
N a v a n e e t h23-Jan-08 22:51
N a v a n e e t h23-Jan-08 22:51 
GeneralGetting the selecteditem from gridview in ajax update panel Pin
Fu Manchu23-Jan-08 22:43
Fu Manchu23-Jan-08 22:43 
hi all,

got a nasty one. Trying to get the selecteditem that a user clicks in an gridview, however the gridview is in an update panel. At first i thought the problem was with the session state - but what actually happens is the update panel does a postback sends everything back to the server but the server only sends back whats in the update panels.

The main problem is when a user clicks the button, this causes an asynchronous postback the event fire in a different order to normal so i detected the button that was pressed after the page load event has fired and therefore miss capturing from session.

Has anyone solved this?

Here is my code: -

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load<br />
       <br />
       Dim selectedItemID As Integer = CType(Session("SelectedItemID"), Integer)<br />
<br />
End Sub



Protected Sub itemsGridView_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles itemsGridView.RowCommand<br />
<br />
        Try<br />
<br />
            Dim selectedItemID As Integer = CType(Session("SelectedItemID"), Integer)<br />
            'Check for custom CommandName Argument<br />
            If e.CommandName = "SelectItem" Then<br />
<br />
                ' Convert the row index stored in the CommandArgument<br />
                ' property to an Integer.<br />
                Dim index As Integer = Convert.ToInt32(e.CommandArgument)<br />
<br />
                ' Retrieve the row that contains the ImageButton clicked<br />
                ' by the user from the Rows collection.<br />
                Dim row As GridViewRow = itemsGridView.Rows(index)<br />
<br />
                ' Get a handle on ImageButton clicked<br />
                Dim imgbtnItem As ImageButton<br />
                imgbtnItem = row.Cells(13).Controls(0)<br />
<br />
            <br />
                selectedItemID = row.Cells(0).Text<br />
<br />
                'Session("SelectedItemID") = selectedItemID<br />
         <br />
            End If<br />
        Catch ex As Exception<br />
            MsgBox(ex.Message.ToString, MsgBoxStyle.Information, "ItemsGridView RowCommand Error!")<br />
        End Try<br />
<br />
<br />
    End Sub

GeneralFixing header in Gridview - Header creeps out of div or panel Pin
maqsoodkoshy23-Jan-08 22:11
maqsoodkoshy23-Jan-08 22:11 
Questionrequired field validator doesnt work Pin
keyto23-Jan-08 21:55
keyto23-Jan-08 21:55 
QuestionUpLoad File Pin
AnhTin23-Jan-08 21:25
AnhTin23-Jan-08 21:25 
GeneralRe: UpLoad File Pin
N a v a n e e t h23-Jan-08 22:39
N a v a n e e t h23-Jan-08 22:39 
GeneralRe: UpLoad File Pin
bhanu1234523-Jan-08 23:59
bhanu1234523-Jan-08 23:59 
Questionhow to handle delete,cut of the textbox using javascript Pin
jagan12323-Jan-08 21:17
jagan12323-Jan-08 21:17 
AnswerRe: how to handle delete,cut of the textbox using javascript Pin
Sandeep Akhare23-Jan-08 23:31
Sandeep Akhare23-Jan-08 23:31 
GeneralDynamic Image Creation Optimization Pin
Expert Coming23-Jan-08 20:19
Expert Coming23-Jan-08 20:19 
GeneralRe: Dynamic Image Creation Optimization Pin
N a v a n e e t h23-Jan-08 22:48
N a v a n e e t h23-Jan-08 22:48 
GeneralProblem in converting HTML page to user control Pin
AumSingh23-Jan-08 20:08
professionalAumSingh23-Jan-08 20:08 
GeneralRe: Problem in converting HTML page to user control Pin
N a v a n e e t h23-Jan-08 21:48
N a v a n e e t h23-Jan-08 21:48 
QuestionHow to use java script code in user control Pin
Sutheesh23-Jan-08 19:47
Sutheesh23-Jan-08 19:47 
AnswerRe: How to use java script code in user control Pin
pmarfleet23-Jan-08 19:51
pmarfleet23-Jan-08 19:51 
GeneralRe: How to use java script code in user control Pin
Sutheesh23-Jan-08 20:03
Sutheesh23-Jan-08 20:03 
GeneralRe: How to use java script code in user control Pin
N a v a n e e t h23-Jan-08 21:44
N a v a n e e t h23-Jan-08 21:44 
GeneralRe: How to use java script code in user control Pin
Sutheesh24-Jan-08 2:53
Sutheesh24-Jan-08 2:53 
GeneralPrinting a report Pin
samerh23-Jan-08 19:21
samerh23-Jan-08 19:21 

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.