create hyperlink field from DB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jagguy
    New Member
    • Sep 2007
    • 23

    create hyperlink field from DB

    I have a column on a grid view I read in froma DB. The field has 2 values true or false. Now if i click on the field i want the gridview and the DB updated to the new value. I click on true on a row and it changes it to false after it has reloaded the page just on that row.

    In PHP you just make a field a hyperlink and send data to another page to update and automatically go back and refresh the page .


    q1)how do i make a value clickable and i can get the whole row details from that?

    PS I do not want to use the edit/select hyperlinks froma gridview. In fact no way do i want to. This is going backwards from a php solution.
  • jagguy
    New Member
    • Sep 2007
    • 23

    #2
    1)ok i have got this far with some basic questions i need to ask.
    when i code in the aspx.vb area (whatever you call the coding area in aspx using vb), can i create template field there instead of what i have below?

    Code:
       <asp:BoundField
            HeaderText="Fname"
            DataField ="fname"
            />
            <asp:TemplateField >
            <ItemTemplate >
            <asp:LinkButton id="one" commandname="two" runat ="server" 'can i create dynamically in aspx.vb code?
             CommandArgument='<%# Bind("id")%>' Text ='<%# Bind("id")%>' >
            </asp:LinkButton>
            </ItemTemplate>
            </asp:TemplateField>
    2)what are the pros and cons of having autgenerated columns? I need to manually list all fields myself which seems a pain .

    Comment

    • jagguy
      New Member
      • Sep 2007
      • 23

      #3
      I can do the link button now .

      q1)could you pojnt me to an example of how i make a template field in the codebehind area rather than the form area?

      q2)What if i have 2 link buttons? when the Rowcommand is raised how do i know which linkbutton raised it?

      q3)many examples i see database fields written in the form page or html area. Why do this when you dont need to if you connect and bind to a DB in the codebehind?

      Comment

      Working...