Help with and user editing and buttons

Author Message
Rikki_UW

  • Total Posts : 5
  • Scores: 0
  • Reward points : 0
  • Joined: 2/7/2008
  • Status: offline
Help with and user editing and buttons Thursday, February 07, 2008 4:46 AM (permalink)
0
Hello all. I have a few questions on basic things I am having trouble with.

First off and easiest, I have a Navigation Frame at the to of my site, with links to the rest of the site, but I want to use buttons instead, as they look better. How can I buttons to link to another page? I tried using teh NavigateUrl attribute like a normal HyperLink in asp.net but it doesn't work. Is there something I could add/modify in the behind code to accomplish this?

Second, I have a datagrid on a page of the site with two date columns that I want to be able to edit. I tried adding an edit column based on another chart with an edit column but it doesn't work properly. When I click edit to change a row, it changes to update or cancel options in that row like it should but it doesn't let me change what I want to. The only reason I can think of is that they are dates and I was basing on editing text. How can I change the code to allow me to edit them? The information is in a MS Access database.

Here is what I have at the moment:

 Public Sub UpdateTraining(ByVal Sender As Object, ByVal e As DataGridCommandEventArgs)
             Dim ID As Int32 = Convert.ToInt32(e.Item.Cells(0).Text)
             Dim otxtNote As TextBox = CType(e.Item.Cells(3).Controls(0), TextBox)
             Dim otxtExpires As TextBox = CType(e.Item.Cells(4).Controls(0), TextBox)
 
             Me.dgTrades.EditItemIndex = -1
 
             Dim SQLInsert As String = "UPDATE Trades SET Note='" & objGlobal.ConvertDbStr(otxtNote.Text) & "' , Expires='" & objGlobal.ConvertDbStr(otxtExpires.Text) & "' WHERE SubcontractorID=" & ID
             Call objGlobal.RunExecute(SQLInsert, Application("CN"))
             Call RefreshGrid(Me.lblID.Text)
         End Sub


Thanks!

--Rikki
 
#1
    Rikki_UW

    • Total Posts : 5
    • Scores: 0
    • Reward points : 0
    • Joined: 2/7/2008
    • Status: offline
    RE: Help with and user editing and buttons Friday, February 08, 2008 3:05 AM (permalink)
    0
    I have managed to figure out the problem with the buttons, but I still cannot figure out what is wrong with my code to edit the date columns.
    Anyone have any ideas?

    --Rikki
     
    #2
      Matt1034

      • Total Posts : 2
      • Scores: 0
      • Reward points : 0
      • Joined: 2/9/2008
      • Status: offline
      RE: Help with and user editing and buttons Sunday, February 10, 2008 6:58 AM (permalink)
      0
      Try using # between the date variables instead of single quotes.

      Assuming Expires is your Date field...

      Expires="# & objGlobal.ConvertDbStr(otxtExpires.Text) & #"

       
      #3
        Rikki_UW

        • Total Posts : 5
        • Scores: 0
        • Reward points : 0
        • Joined: 2/7/2008
        • Status: offline
        RE: Help with and user editing and buttons Monday, February 11, 2008 1:09 AM (permalink)
        0
        Thank you for your reply, but it seems I have made a mistake. In the Access database where the info is coming from Expires and Note(now changed to Received) are text fields, but on the web page I want to use the text boxes to force the user to enter a date in a specific format so that everything ends up looking the same. How would I accomplish this? At the moment I am just editing them as text.

        --Rikki
        <message edited by Rikki_UW on Monday, February 11, 2008 3:38 AM>
         
        #4

          Online Bookmarks Sharing: Share/Bookmark

          Jump to:

          Current active users

          There are 0 members and 1 guests.

          Icon Legend and Permission

          • New Messages
          • No New Messages
          • Hot Topic w/ New Messages
          • Hot Topic w/o New Messages
          • Locked w/ New Messages
          • Locked w/o New Messages
          • Read Message
          • Post New Thread
          • Reply to message
          • Post New Poll
          • Submit Vote
          • Post reward post
          • Delete my own posts
          • Delete my own threads
          • Rate post

          2000-2012 ASPPlayground.NET Forum Version 3.9