Showing posts with label whenever. Show all posts
Showing posts with label whenever. Show all posts

Wednesday, March 28, 2012

Tab container problem

I am having a problem with my tab panel/tab container. Whenever I make a change or click in a tab it refreshes and takes me to the tab called pictures upload/modify. I want to be able to make changes in a tab and stay in that tab not switch tabs. I'm not sure what is causing this any ideas?

Here is the code:

<%@dotnet.itags.org. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@dotnet.itags.org. Page Language="VB" MasterPageFile="~/masterpage.master" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CORE2062ConnectionString1 %>"
DeleteCommand="DELETE FROM [Scrollbar] WHERE [EventID] = @dotnet.itags.org.EventID" InsertCommand="INSERT INTO [Scrollbar] ([Event]) VALUES (@dotnet.itags.org.Event)"
SelectCommand="SELECT * FROM [Scrollbar]" UpdateCommand="UPDATE [Scrollbar] SET [Event] = @dotnet.itags.org.Event WHERE [EventID] = @dotnet.itags.org.EventID">
<DeleteParameters>
<asp:Parameter Name="EventID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Event" Type="String" />
<asp:Parameter Name="EventID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Event" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConflictDetection="CompareAllValues"
ConnectionString="<%$ ConnectionStrings:CORE2062ConnectionString1 %>" DeleteCommand="DELETE FROM [Picture] WHERE [Picture_ID] = @dotnet.itags.org.original_Picture_ID AND [Picture_Name] = @dotnet.itags.org.original_Picture_Name AND [Picture_Description] = @dotnet.itags.org.original_Picture_Description AND [Picture_Date] = @dotnet.itags.org.original_Picture_Date AND [Picture_User] = @dotnet.itags.org.original_Picture_User AND [Picture_Path] = @dotnet.itags.org.original_Picture_Path"
InsertCommand="INSERT INTO [Picture] ([Picture_Name], [Picture_Description], [Picture_Date], [Picture_User], [Picture_Path]) VALUES (@dotnet.itags.org.Picture_Name, @dotnet.itags.org.Picture_Description, @dotnet.itags.org.Picture_Date, @dotnet.itags.org.Picture_User, @dotnet.itags.org.Picture_Path)"
OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [Picture]"
UpdateCommand="UPDATE [Picture] SET [Picture_Name] = @dotnet.itags.org.Picture_Name, [Picture_Description] = @dotnet.itags.org.Picture_Description, [Picture_Date] = @dotnet.itags.org.Picture_Date, [Picture_User] = @dotnet.itags.org.Picture_User, [Picture_Path] = @dotnet.itags.org.Picture_Path WHERE [Picture_ID] = @dotnet.itags.org.original_Picture_ID AND [Picture_Name] = @dotnet.itags.org.original_Picture_Name AND [Picture_Description] = @dotnet.itags.org.original_Picture_Description AND [Picture_Date] = @dotnet.itags.org.original_Picture_Date AND [Picture_User] = @dotnet.itags.org.original_Picture_User AND [Picture_Path] = @dotnet.itags.org.original_Picture_Path">
<DeleteParameters>
<asp:Parameter Name="original_Picture_ID" Type="Int32" />
<asp:Parameter Name="original_Picture_Name" Type="String" />
<asp:Parameter Name="original_Picture_Description" Type="String" />
<asp:Parameter Name="original_Picture_Date" Type="DateTime" />
<asp:Parameter Name="original_Picture_User" Type="String" />
<asp:Parameter Name="original_Picture_Path" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Picture_Name" Type="String" />
<asp:Parameter Name="Picture_Description" Type="String" />
<asp:Parameter Name="Picture_Date" Type="DateTime" />
<asp:Parameter Name="Picture_User" Type="String" />
<asp:Parameter Name="Picture_Path" Type="String" />
<asp:Parameter Name="original_Picture_ID" Type="Int32" />
<asp:Parameter Name="original_Picture_Name" Type="String" />
<asp:Parameter Name="original_Picture_Description" Type="String" />
<asp:Parameter Name="original_Picture_Date" Type="DateTime" />
<asp:Parameter Name="original_Picture_User" Type="String" />
<asp:Parameter Name="original_Picture_Path" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Picture_Name" Type="String" />
<asp:Parameter Name="Picture_Description" Type="String" />
<asp:Parameter Name="Picture_Date" Type="DateTime" />
<asp:Parameter Name="Picture_User" Type="String" />
<asp:Parameter Name="Picture_Path" Type="String" />
</InsertParameters>
</asp:SqlDataSource>

<cc1:TabContainer ID="TabContainer1" runat="server" width="875px" style="z-index: 133; left: 20px; position: absolute; top: 300px" BackColor="Transparent">
<cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Events Data">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="EventID"
DataSourceID="SqlDataSource2" EmptyDataText="There are no data records to display.">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="EventID" HeaderText="EventID" ReadOnly="True" SortExpression="EventID" />
<asp:BoundField DataField="EventName" HeaderText="EventName" SortExpression="EventName" />
<asp:BoundField DataField="EventDate" HeaderText="EventDate" SortExpression="EventDate"/>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource8" runat="server" ConnectionString="<%$ ConnectionStrings:CORE2062ConnectionString5 %>"
DeleteCommand="DELETE FROM [Events] WHERE [EventID] = @dotnet.itags.org.EventID" InsertCommand="INSERT INTO [Events] ([EventName], [EventDate]) VALUES (@dotnet.itags.org.EventName, @dotnet.itags.org.EventDate)"
ProviderName="<%$ ConnectionStrings:CORE2062ConnectionString5.ProviderName %>"
SelectCommand="SELECT [EventID], [EventName], [EventDate] FROM [Events]" UpdateCommand="UPDATE [Events] SET [EventName] = @dotnet.itags.org.EventName, [EventDate] = @dotnet.itags.org.EventDate WHERE [EventID] = @dotnet.itags.org.EventID">
<InsertParameters>
<asp:Parameter Name="EventName" Type="String" />
<asp:Parameter Name="EventDate" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="EventName" Type="String" />
<asp:Parameter Name="EventDate" Type="String" />
<asp:Parameter Name="EventID" Type="Int32" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="EventID" Type="Int32" />
</DeleteParameters>
</asp:SqlDataSource>
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="EventID"
DataSourceID="SqlDataSource2" DefaultMode="Insert" Height="50px" Width="125px">
<Fields>
<asp:BoundField DataField="EventID" HeaderText="EventID" InsertVisible="False" ReadOnly="True"
SortExpression="EventID" />
<asp:BoundField DataField="EventName" HeaderText="EventName" SortExpression="EventName" />
<asp:BoundField DataField="EventDate" HeaderText="EventDate" SortExpression="EventDate" />
<asp:CommandField ShowInsertButton="True" />
</Fields>
</asp:DetailsView>
<br />
<asp:SqlDataSource ID="SqlDataSource6" runat="server" ConnectionString="<%$ ConnectionStrings:CORE2062ConnectionString4 %>"
DeleteCommand="DELETE FROM [Scrollbar] WHERE [EventID] = @dotnet.itags.org.EventID" InsertCommand="INSERT INTO [Scrollbar] ([Event]) VALUES (@dotnet.itags.org.Event)"
ProviderName="<%$ ConnectionStrings:CORE2062ConnectionString4.ProviderName %>"
SelectCommand="SELECT [EventID], [Event] FROM [Scrollbar]" UpdateCommand="UPDATE [Scrollbar] SET [Event] = @dotnet.itags.org.Event WHERE [EventID] = @dotnet.itags.org.EventID">
<InsertParameters>
<asp:Parameter Name="Event" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Event" Type="String" />
<asp:Parameter Name="EventID" Type="Int32" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="EventID" Type="Int32" />
</DeleteParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource7" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:CORE2062ConnectionString4 %>" DeleteCommand="DELETE FROM [Scrollbar] WHERE [EventID] = @dotnet.itags.org.original_EventID AND [Event] = @dotnet.itags.org.original_Event" InsertCommand="INSERT INTO [Scrollbar] ([Event]) VALUES (@dotnet.itags.org.Event)" OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [Scrollbar]" UpdateCommand="UPDATE [Scrollbar] SET [Event] = @dotnet.itags.org.Event WHERE [EventID] = @dotnet.itags.org.original_EventID AND [Event] = @dotnet.itags.org.original_Event">
<DeleteParameters>
<asp:Parameter Name="original_EventID" Type="Int32" />
<asp:Parameter Name="original_Event" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Event" Type="String" />
<asp:Parameter Name="original_EventID" Type="Int32" />
<asp:Parameter Name="original_Event" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Event" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<br />
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataKeyNames="EventID"
DataSourceID="SqlDataSource7">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="EventID" HeaderText="EventID" InsertVisible="False" ReadOnly="True"
SortExpression="EventID" />
<asp:BoundField DataField="Event" HeaderText="Event" SortExpression="Event" />
</Columns>
</asp:GridView>

</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Users">
<ContentTemplate>
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server">
<WizardSteps>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
</asp:CreateUserWizardStep>
<asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
</asp:CompleteWizardStep>
</WizardSteps>
</asp:CreateUserWizard>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel3" runat="server" HeaderText="Pictures Upload/Modify">
<ContentTemplate>
<asp:FileUpload ID="FileUpload1" runat="server" />
<br /><asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Upload" />
<asp:Label ID="Label1" runat="server" Text="Please browse for a picture and then complete the following form."></asp:Label>
<asp:Label ID="Label2" runat="server" style="z-index: 100; left: 338px; position: absolute; top: 372px"></asp:Label>

<asp:DetailsView ID="DetailsView2" runat="server" AutoGenerateRows="False" DataKeyNames="Picture_ID"
DataSourceID="SqlDataSource3" DefaultMode="Insert" Height="50px" Width="125px">
<Fields>
<asp:BoundField DataField="Picture_ID" HeaderText="ID" InsertVisible="False"
ReadOnly="True" SortExpression="Picture_ID" />
<asp:BoundField DataField="Picture_Name" HeaderText="Name" SortExpression="Picture_Name" />
<asp:BoundField DataField="Picture_Description" HeaderText="Picture Description(optional)"
SortExpression="Picture_Description" />
<asp:BoundField DataField="Picture_Date" HeaderText="Date" SortExpression="Picture_Date(optional)" />
<asp:BoundField DataField="Picture_User" HeaderText="User" SortExpression="Picture_User" />
<asp:BoundField DataField="Picture_Path" HeaderText="Path" SortExpression="Picture_Path" NullDisplayText="FileUpload1.PostedFile.FileName"/>
<asp:CommandField ShowInsertButton="True"/>
</Fields>
</asp:DetailsView>

<asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" DataKeyNames="Picture_ID"
DataSourceID="SqlDataSource5" EmptyDataText="There are no data records to display.">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="Picture_ID" HeaderText="Picture_ID" ReadOnly="True" SortExpression="Picture_ID" />
<asp:BoundField DataField="Picture_Name" HeaderText="Picture_Name" SortExpression="Picture_Name" />
<asp:BoundField DataField="Picture_Description" HeaderText="Picture_Description"
SortExpression="Picture_Description" />
<asp:BoundField DataField="Picture_Date" HeaderText="Picture_Date" SortExpression="Picture_Date" />
<asp:BoundField DataField="Picture_User" HeaderText="Picture_User" SortExpression="Picture_User" />
<asp:BoundField DataField="Picture_Path" HeaderText="Picture_Path" SortExpression="Picture_Path" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:CORE2062ConnectionString3 %>"
DeleteCommand="DELETE FROM [Picture] WHERE [Picture_ID] = @dotnet.itags.org.Picture_ID" InsertCommand="INSERT INTO [Picture] ([Picture_Name], [Picture_Description], [Picture_Date], [Picture_User], [Picture_Path]) VALUES (@dotnet.itags.org.Picture_Name, @dotnet.itags.org.Picture_Description, @dotnet.itags.org.Picture_Date, @dotnet.itags.org.Picture_User, @dotnet.itags.org.Picture_Path)"
ProviderName="<%$ ConnectionStrings:CORE2062ConnectionString3.ProviderName %>"
SelectCommand="SELECT [Picture_ID], [Picture_Name], [Picture_Description], [Picture_Date], [Picture_User], [Picture_Path] FROM [Picture]"
UpdateCommand="UPDATE [Picture] SET [Picture_Name] = @dotnet.itags.org.Picture_Name, [Picture_Description] = @dotnet.itags.org.Picture_Description, [Picture_Date] = @dotnet.itags.org.Picture_Date, [Picture_User] = @dotnet.itags.org.Picture_User, [Picture_Path] = @dotnet.itags.org.Picture_Path WHERE [Picture_ID] = @dotnet.itags.org.Picture_ID">
<InsertParameters>
<asp:Parameter Name="Picture_Name" Type="String" />
<asp:Parameter Name="Picture_Description" Type="String" />
<asp:Parameter Name="Picture_Date" Type="DateTime" />
<asp:Parameter Name="Picture_User" Type="String" />
<asp:Parameter Name="Picture_Path" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Picture_Name" Type="String" />
<asp:Parameter Name="Picture_Description" Type="String" />
<asp:Parameter Name="Picture_Date" Type="DateTime" />
<asp:Parameter Name="Picture_User" Type="String" />
<asp:Parameter Name="Picture_Path" Type="String" />
<asp:Parameter Name="Picture_ID" Type="Int32" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="Picture_ID" Type="Int32" />
</DeleteParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:CORE2062ConnectionString1 %>"
DeleteCommand="DELETE FROM [Picture] WHERE [Picture_ID] = @dotnet.itags.org.Picture_ID" InsertCommand="INSERT INTO [Picture] ([Picture_Name], [Picture_Description], [Picture_Date], [Picture_User], [Picture_Path]) VALUES (@dotnet.itags.org.Picture_Name, @dotnet.itags.org.Picture_Description, @dotnet.itags.org.Picture_Date, @dotnet.itags.org.Picture_User, @dotnet.itags.org.Picture_Path)"
ProviderName="<%$ ConnectionStrings:CORE2062ConnectionString1.ProviderName %>"
SelectCommand="SELECT [Picture_ID], [Picture_Name], [Picture_Description], [Picture_Date], [Picture_User], [Picture_Path] FROM [Picture]"
UpdateCommand="UPDATE [Picture] SET [Picture_Name] = @dotnet.itags.org.Picture_Name, [Picture_Description] = @dotnet.itags.org.Picture_Description, [Picture_Date] = @dotnet.itags.org.Picture_Date, [Picture_User] = @dotnet.itags.org.Picture_User, [Picture_Path] = @dotnet.itags.org.Picture_Path WHERE [Picture_ID] = @dotnet.itags.org.Picture_ID">
<InsertParameters>
<asp:Parameter Name="Picture_Name" Type="String" />
<asp:Parameter Name="Picture_Description" Type="String" />
<asp:Parameter Name="Picture_Date" Type="DateTime" />
<asp:Parameter Name="Picture_User" Type="String" />
<asp:Parameter Name="Picture_Path" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Picture_Name" Type="String" />
<asp:Parameter Name="Picture_Description" Type="String" />
<asp:Parameter Name="Picture_Date" Type="DateTime" />
<asp:Parameter Name="Picture_User" Type="String" />
<asp:Parameter Name="Picture_Path" Type="String" />
<asp:Parameter Name="Picture_ID" Type="Int32" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="Picture_ID" Type="Int32" />
</DeleteParameters>
</asp:SqlDataSource>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel4" runat="server" HeaderText="Meeting Notes">
<ContentTemplate>

<asp:GridView ID="GridView4" runat="server" AutoGenerateColumns="False" DataKeyNames="Meeting_ID"
DataSourceID="SqlDataSource9" EmptyDataText="There are no data records to display." AllowSorting="True">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="Meeting_ID" HeaderText="Meeting_ID" ReadOnly="True" SortExpression="Meeting_ID" />
<asp:BoundField DataField="Meeting_Date" HeaderText="Meeting_Date" SortExpression="Meeting_Date" />
<asp:BoundField DataField="Meeting_Title" HeaderText="Meeting_Title" SortExpression="Meeting_Title" />
<asp:BoundField DataField="Meeting_Description" HeaderText="Meeting_Description"
SortExpression="Meeting_Description" />
<asp:BoundField DataField="Meeting_Topic1" HeaderText="Meeting_Topic1" SortExpression="Meeting_Topic1" />
<asp:BoundField DataField="Meeting_Notes1" HeaderText="Meeting_Notes1" SortExpression="Meeting_Notes1" />
<asp:BoundField DataField="Meeting_Topic2" HeaderText="Meeting_Topic2" SortExpression="Meeting_Topic2" />
<asp:BoundField DataField="Meeting_Notes2" HeaderText="Meeting_Notes2" SortExpression="Meeting_Notes2" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource9" runat="server" ConnectionString="<%$ ConnectionStrings:CORE2062ConnectionString1 %>"
DeleteCommand="DELETE FROM [Meeting] WHERE [Meeting_ID] = @dotnet.itags.org.Meeting_ID" InsertCommand="INSERT INTO [Meeting] ([Meeting_Date], [Meeting_Title], [Meeting_Description], [Meeting_Topic1], [Meeting_Notes1], [Meeting_Topic2], [Meeting_Notes2]) VALUES (@dotnet.itags.org.Meeting_Date, @dotnet.itags.org.Meeting_Title, @dotnet.itags.org.Meeting_Description, @dotnet.itags.org.Meeting_Topic1, @dotnet.itags.org.Meeting_Notes1, @dotnet.itags.org.Meeting_Topic2, @dotnet.itags.org.Meeting_Notes2)"
ProviderName="<%$ ConnectionStrings:CORE2062ConnectionString1.ProviderName %>"
SelectCommand="SELECT [Meeting_ID], [Meeting_Date], [Meeting_Title], [Meeting_Description], [Meeting_Topic1], [Meeting_Notes1], [Meeting_Topic2], [Meeting_Notes2] FROM [Meeting]"
UpdateCommand="UPDATE [Meeting] SET [Meeting_Date] = @dotnet.itags.org.Meeting_Date, [Meeting_Title] = @dotnet.itags.org.Meeting_Title, [Meeting_Description] = @dotnet.itags.org.Meeting_Description, [Meeting_Topic1] = @dotnet.itags.org.Meeting_Topic1, [Meeting_Notes1] = @dotnet.itags.org.Meeting_Notes1, [Meeting_Topic2] = @dotnet.itags.org.Meeting_Topic2, [Meeting_Notes2] = @dotnet.itags.org.Meeting_Notes2 WHERE [Meeting_ID] = @dotnet.itags.org.Meeting_ID">
<InsertParameters>
<asp:Parameter Name="Meeting_Date" Type="DateTime" />
<asp:Parameter Name="Meeting_Title" Type="String" />
<asp:Parameter Name="Meeting_Description" Type="String" />
<asp:Parameter Name="Meeting_Topic1" Type="String" />
<asp:Parameter Name="Meeting_Notes1" Type="String" />
<asp:Parameter Name="Meeting_Topic2" Type="String" />
<asp:Parameter Name="Meeting_Notes2" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Meeting_Date" Type="DateTime" />
<asp:Parameter Name="Meeting_Title" Type="String" />
<asp:Parameter Name="Meeting_Description" Type="String" />
<asp:Parameter Name="Meeting_Topic1" Type="String" />
<asp:Parameter Name="Meeting_Notes1" Type="String" />
<asp:Parameter Name="Meeting_Topic2" Type="String" />
<asp:Parameter Name="Meeting_Notes2" Type="String" />
<asp:Parameter Name="Meeting_ID" Type="Int32" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="Meeting_ID" Type="Int32" />
</DeleteParameters>
</asp:SqlDataSource>
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
<script language="vbscript" runat="server">
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim filename = "upload/" & FileUpload1.PostedFile.FileName
If FileUpload1.HasFile Then
Try
FileUpload1.SaveAs(Server.MapPath("~/upload/") & _
FileUpload1.FileName)
Label1.Text = "File name: " & "upload/" & _
FileUpload1.PostedFile.FileName & "<br>" & _
"File Size: " & _
FileUpload1.PostedFile.ContentLength & " kb<br>" & _
"Content type: " & _
FileUpload1.PostedFile.ContentType
Catch ex As Exception
Label1.Text = "ERROR: " & ex.Message.ToString()
Label2.Text = filename
End Try
Else
Label1.Text = "You have not specified a file."
End If
End Sub
</script>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConflictDetection="CompareAllValues"
ConnectionString="<%$ ConnectionStrings:CORE2062ConnectionString1 %>" DeleteCommand="DELETE FROM [Events] WHERE [EventID] = @dotnet.itags.org.original_EventID AND [EventName] = @dotnet.itags.org.original_EventName AND [EventDate] = @dotnet.itags.org.original_EventDate"
InsertCommand="INSERT INTO [Events] ([EventName], [EventDate]) VALUES (@dotnet.itags.org.EventName, @dotnet.itags.org.EventDate)"
OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [Events]"
UpdateCommand="UPDATE [Events] SET [EventName] = @dotnet.itags.org.EventName, [EventDate] = @dotnet.itags.org.EventDate WHERE [EventID] = @dotnet.itags.org.original_EventID AND [EventName] = @dotnet.itags.org.original_EventName AND [EventDate] = @dotnet.itags.org.original_EventDate">
<DeleteParameters>
<asp:Parameter Name="original_EventID" Type="Int32" />
<asp:Parameter Name="original_EventName" Type="String" />
<asp:Parameter Name="original_EventDate" Type="DateTime" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="EventName" Type="String" />
<asp:Parameter Name="EventDate" Type="DateTime" />
<asp:Parameter Name="original_EventID" Type="Int32" />
<asp:Parameter Name="original_EventName" Type="String" />
<asp:Parameter Name="original_EventDate" Type="DateTime" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="EventName" Type="String" />
<asp:Parameter Name="EventDate" Type="DateTime" />
</InsertParameters>
</asp:SqlDataSource>
</asp:Content

Hi,

According to my understanding to your problem, it's ActiveTabIndex isn't maintained between postback.

You can refer to this thread talks about the same thing and try the workaround in it.

http://forums.asp.net/t/1157255.aspx

Monday, March 26, 2012

Tab Control Not working Properly in Update Panel.

I am having one update panel. inside that having some ASP Controls and a Tab Control. Now whenever this Update panel tries to Update, My tab control gets disappeared. It is not displyaed on the page.

Can you elaborate on what you are trying to do eg.

UpdatePanel -> Tab Container -> Tab - Some ASP.NET controls

Also, are you doing this in the Designer in Visual Studio? ie drag and drop designing.? otherwise?


Hi mistry,

To indicate the real problem, your source code is needed.However , here is the url that has a sample shows how to use these controls (Please focus on the source code). Hope it helps.

http://forums.asp.net/p/1128124/1784927.aspx#1784927

If your problem is still exist, please let me know.


Hi,

I tried what you described, it worked fine. Here is my code:

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void Page_Load(object sender, EventArgs e) { Label1.Text = DateTime.Now.ToString(); }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> </div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="1"> <ajaxToolkit:TabPanel ID="TabPanel1" runat="server" HeaderText="TabPanel1"> <ContentTemplate> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel2"> <ContentTemplate> <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer> <asp:Button ID="Button1" runat="server" Text="Button" /> </ContentTemplate> </asp:UpdatePanel> </form></body></html>
You may compare it with your code to find out the reason.

Saturday, March 24, 2012

TabContainer and Firefox 2.0.0.2 Postback Issue

After updating Firefox to 2.0.0.2 yesterday, all my TabContainers have stopped functioning. Whenever a postback occurs, the entire TabContainer disappears and I get a javascript errorError: Sys.InvalidOperationException: Component 'ctl00_ContentPlaceHolder1_TabSet1' was not found.

Tested in IE 7 and they continue to work, and they were working fine until updating to the new version of Firefox.

It appears to do it only when the tabcontainer is inside an updatepanel, not when the updatepanel is inside the tabcontainer

This has become a problem for me - I had to remove all update panels that I had associated with my TabContainer control. Here is a little more info on the problem:

Repro:
In FireFox 2.0.0.2 only...
See below for .aspx file to test against. In short, put a TabContainer inside of an update panel, cause a post back to occur.

Expected:
Postback should occur normally, tab container is updated inline.

Actual:
Javascript exception is thrown, Error.invalidOperation() , in file (I believe) MicrosoftAjax.js, function function Sys$Component$_setReferences(component, references) .

Notes:
* http://www.mozilla.com/en-US/firefox/2.0.0.2/releasenotes/
* Stepping through the code actually seems fine - but I've not done much debugging in this particular portion of Ajax.


<%-- Sample, broken TabContainer inside of Update Panel --%>

<%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %><html><body><form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="Server" /> <asp:UpdatePanel runat="server" ID="updatePanelForTestControl" UpdateMode="Conditional"> <ContentTemplate> <ajaxToolkit:TabContainer runat="server" ID="Tabs" ActiveTabIndex="1"> <ajaxToolkit:TabPanel runat="Server" ID="Panel1" HeaderText="Tab 01"> <ContentTemplate> First tab panel </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel runat="Server" ID="Panel2" HeaderText="Tab 02" > <ContentTemplate> Second tab panel <asp:Button ID="Button1" runat="Server" Text="Post Back" /> </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer> </ContentTemplate> </asp:UpdatePanel></form></body></html>

I'm not sure who owns the responsibility here - if it's an update panel issue, or a TabContainer issue. As such, I posted an "issue" on the AjaxControlToolkit forums:

http://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=8532

Regards,
Kevin


Investigation is ongoing. What appears to be the case is that the Firefox 2.0.0.2 update changed the ordering of two browser events UpdatePanel uses in such a way as to break certain aspects of ASP.NET AJAX. Microsoft folks are looking into the issue now and should update this thread (or maybe post a new, sticky one) once they know more.


that is casewe are working with the firefox team actively to figure out the best approach to address this issue and we will update this thread as soon as we know more about it.

Just to expand on this, my customers have told me of problems with Telerik RadAJAX and MagicAJAX when FireFox 2.0.0.2 was installed.

Telerik has already published a fix:http://www.telerik.com/community/forums/thread/b311D-tccek.aspx

I have yet to validate the MagicAJAX problem.

From my perspective as a custom controls developer, it sounds like FireFox did a bad thing because they've broken a lot of AJAX-based sites.


FYI, the ASP.NET AJAX team will be tracking this issue here:http://forums.asp.net/thread/1600941.aspx

Please check there for up-to-date information.


It seems that in FireFox 2.0.0.2 dynamically loaded javascript files (much needed by all AJAX frameworks) are handled in a completely different fashion, whici as far as I can see is causing major problems fror all AJAX frameworks. The guys from telerik are ready with the update and created a hotfix (Q4 SP2) - so if you are using telerik r.a.d.ajax - just upgrade. I'm sure Microsoft guys will respond as quickly as possible as well (and I am well aware that for company like Microsoft and for product like ASP.NET AJAX this will take some time).

Here is the bug I believe is related (since I've seen most AJAX libraries use the innerHTML approach for dynamically loading javascript under the hood).

https://bugzilla.mozilla.org/show_bug.cgi?id=371628