Issues with LinkButtons

wings9697

Member
Joined
Aug 27, 2007
Messages
23
Location
Washington, DC
Programming Experience
10+
Hi. I have a form which I'm using to store data from individual case investigations. I am using web form templates to hold each of the documents needed for each case.

The problem I'm having is that the templates wont work unless I use the created LinkButtons that they create. When I tried to use regular Button controls set exactly like the LinkButtons, my forms would not connect to the SQL tables I had created. When I went back to the LinkButtons, everything was fine. Now the problem is if I attempt any kind of Postback command from the Insert LinkButton, A - my table connection gets broken again, and B, it doesn't go back to the page I selected, it just stays on the Entry page with both the Insert LinkButton, and the Cancel LinkButton enabled.

I've tried to recast the Visible function on the Click of the LinkButton, I even tried to create an event to force the issue (see below), but again it worked and went back to the menu but wouldn't insert the record into the table...

VB.NET:
 <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                Text="Insert New Case" Width="109px"
                OnClientClick="return confirm('Case now being stored in Main Caselog...');"
                OnClick="CloseInsertForm">
            </asp:LinkButton></td>

VB.NET:
  Protected Sub CloseInsertForm(ByVal sender As Object, ByVal e As System.EventArgs)
        Response.Redirect("~/Mainmenu.aspx")
    End Sub

Does anyone have any idea what I can do to solve this problem? I'm open to any suggestions....
 
Back
Top