Results 1 to 3 of 3

Thread: [2005] GridView Problem

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2007
    Posts
    39

    [2005] GridView Problem

    I have a GridView in my aspx form. In that gridview i have some boundfields.
    I have a auto generated button name "Click Me" in template.

    After clicking on the button "Click Me", I want a popup window will raise (somepage.aspx).
    the "Click Me" button will pass the row information (bound fields value) in session.

    Could anyone please help me how to do that with codes. I am a novice in asp.net.(I am using c#, asp.net2005)

  2. #2
    Frenzied Member brin351's Avatar
    Join Date
    Mar 2007
    Location
    Land Down Under
    Posts
    1,293

    Re: [2005] GridView Problem

    if you need to popup a window I'd use javascript and the client side onClick to call it and pass the info in the querystring to the popup window, that is If you can avoid using a session and postback.


    Code:
    <script type="text/javascript">
     function popup(url){
        window.open(url,'',width=450,height=450')
    }
    </script>
    
    
    <grid....>
    
    <template....>
    
      <a href="javascript:void(0)" onClick="popup('yourURL.aspx?keyFied=<%#DataBinder.Eval(Container.DataItem, "dataBaseFieldName")%>">Click Me</a>
    
    </template>

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] GridView Problem

    You can generate the onClick code using the RowDataBound event of the GridView. I prefer it to using inline code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width