In the Telerik Recurrence Editor control I want to hide "No End Date" while leaving "End After" and "End By". I can't allow my clients the ability to make recurring reservations with no end date.
I was able to hide the option button by finding the id of the control but there is no id for the label of that option button. So, I can hide the radio button but not the label for it.
Can anyone provide some code for this?
One work around would be to validate that the No End Date option is not selected after post back but I'd rather not do that.
Thanks,
Rob
Protected Sub btn_ModifyPerms_Click(sender As Object, e As System.EventArgs) For Each grdItem As GridDataItem In rgd_TaskPermissions.Items Dim cbx_Select As CheckBox = DirectCast(grdItem.FindControl("cbx_Select"), CheckBox) 'Do Something If cbx_Select.Checked = False Then Session("PermSelect") = 0 Else Session("PermSelect") = 1 End If Dim DatabaseName As String = Session("DBName") Dim Table As String = Session("Table") Dim TaskRole As String = Session("TaskRole") Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=itc.sysadmin;PWD=m1s.@dm1n6;") Dim command = New SqlCommand("aa_task_table_permissions_select", connectionString) command.CommandType = CommandType.StoredProcedure command.Parameters.Add("@dbname", SqlDbType.VarChar).Value = DatabaseName command.Parameters.Add("@Table", SqlDbType.VarChar).Value = Table command.Parameters.Add("@TaskRole", SqlDbType.VarChar).Value = Session("TaskRole") command.Parameters.Add("@PermSelect", SqlDbType.Int).Value = Session("PermSelect") command.Connection.Open() command.ExecuteNonQuery() command.Connection.Close() Next End SubAddNewRecordText for my grid
what do?
<telerik:GridTemplateColumn DataField="Qty" DataType="System.Decimal" HeaderText="Qty" SortExpression="Qty" UniqueName="Qty"> <EditItemTemplate> <telerik:RadNumericTextBox Width="40px" MinValue="0" MaxValue="9999999.99" Type="Number" ID="QtyTextBox" Text='<%# Bind("Qty") %>' InvalidStyleDuration="1000" NumberFormat-DecimalDigits="2" runat="server" MaxLength="20"> <ClientEvents OnLoad="RemoveZeros" OnBlur="RemoveZeros" OnValueChanged="RemoveZeros" /> </telerik:RadNumericTextBox> <asp:RangeValidator ID="rngQty" runat="server" ControlToValidate="QtyTextBox" ErrorMessage="<br />Must be a number" Display="Dynamic" MinimumValue="0" MaximumValue="999999999" Type="Double"></asp:RangeValidator> <asp:RequiredFieldValidator ID="reqQty" ControlToValidate="QtyTextBox" runat="server" Display="Dynamic" ErrorMessage="<br />A quantity is required."></asp:RequiredFieldValidator> </EditItemTemplate> <ItemTemplate> <asp:Label ID="QtyLabel" runat="server" Text='<%# FormatDecimalWithoutUnusedDecimals( Eval("Qty")) %>'></asp:Label> </ItemTemplate> <ItemStyle Width="55px" /> <HeaderStyle Width="55px" /> <FooterStyle HorizontalAlign="Right" /> <FooterTemplate> </FooterTemplate> </telerik:GridTemplateColumn>Protected Sub RadGrid1_ItemCommand(ByVal source As Object, _ ByVal e As Telerik.Web.UI.GridCommandEventArgs) _ Handles RadGrid1.ItemCommand Dim newValues As New Hashtable If e.CommandName = "UpdateAll" Then UpdateShipment(Nothing, Nothing) For Each editedItem As GridEditableItem In RadGrid1.EditItems e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem) Dim QtyTextBox As RadNumericTextBox QtyTextBox = CType(editedItem("Qty").FindControl("QtyTextBox"), RadNumericTextBox) UpdateRowValue(newValues) Next RadGrid1.EditIndexes.Clear() RadGrid1.Rebind() End IfEnd Subfunction RemoveZeros(sender, args) { var tbValue = sender._textBoxElement.value; if (tbValue.indexOf(".00") != -1) sender._textBoxElement.value = tbValue.substr(0, tbValue.indexOf(".00")); }<
meta http-equiv="X-UA-Compatible" content="IE=7" /> tag on the page, but thats not really an acceptable solution.
thanks for any suggestions.
peter
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="user_lookup_site.aspx.vb" Inherits="_Default" %> <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Aeries Global System Manager</title> <link rel="stylesheet" type="text/css" href="~/includes/ITC_Main.css" /> <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> function refreshGrid(arg) { if (!arg) { $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind"); } else { $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate"); } } </script> </telerik:RadCodeBlock> </head> <body> <form id="form1" runat="server"> <div id="header"> <table cellpadding="0" cellspacing="0" style="width: 100%; height: 40px;"> <tr> <td style="width: 200px; vertical-align: middle; text-align: center;"> <img alt="" src="../../images/aalogo.gif" style="width: 169px; height: 35px" /></td> <td style="text-align: center;"> <datelbl:ShowDate ID="ShowDate1" runat="server" /> </td> <td style="width: 300px; text-align: center;"> <table cellpadding="2" cellspacing="0" style="width: 292px; height: 40px; background-image: url('../../images/headerinset.gif'); text-align: center;"> <tr> <td style="font-weight: bold; font-size: small; font-family: Arial, Helvetica, sans-serif; color: #00B000; text-align: center;"> Logged in as: <asp:LoginName ID="LoginName1" runat="server" Font-Names="Arial" Font-Size="Small" ForeColor="#597791" meta:resourcekey="LoginName1Resource1" /> <asp:LoginStatus ID="LoginStatus1" runat="server" CssClass="login" meta:resourcekey="LoginStatus1Resource1" /> </td> </tr> </table></td> <td style="text-align: center; vertical-align: middle; width: 175px;"> <img alt="" src="../../images/aatusdlogo.gif" style="width: 152px; height: 36px" /></td> </tr> </table> </div> <div id="subheader"> </div> <div> <table cellpadding="0" cellspacing="0" style="width: 100%"> <tr> <td style="width: 250px; background-image: url('../../images/menuback.gif'); background-color: #E6E6E6; border-bottom-style: solid; border-bottom-width: thin; border-bottom-color: #000000;" valign="top"> <telerik:RadPanelBar ID="rpb_AA_Menu" Runat="server" DataFieldID="DataFieldID" DataFieldParentID="DataFieldParentID" DataNavigateUrlField="DataNavigateUrlField" DataSourceID="sds_AA_Menu" DataTextField="DataTextField" DataValueField="DataTextField" Width="250px" PersistStateInCookie="True" Skin="Office2007"> <DataBindings> <telerik:RadPanelItemBinding SelectedImageUrlField="ImageURL" ExpandedImageUrlField="ImageURL" HoveredImageUrlField="ImageURL" ImageUrlField="ImageURL" /> <telerik:RadPanelItemBinding ImageUrlField="ImageURL" /> </DataBindings> </telerik:RadPanelBar> </td> <td valign="top" style="background-color: #FFFFFF; border-bottom-style: solid; border-bottom-width: thin; border-bottom-color: #000000;"> <table cellpadding="0" cellspacing="0" style="width: 100%"> <tr> <td style="padding: 10px"> <h1> ABI User Manager - User Lookup by Site</h1> <h2> Database</h2> <telerik:RadComboBox ID="rcb_Database" Runat="server" DataSourceID="sds_Database" DataTextField="DatabaseName" DataValueField="DatabaseName" AppendDataBoundItems="True"> <Items> <telerik:RadComboBoxItem Value = "" Text="Select" /> </Items> </telerik:RadComboBox> <h2> Site </h2> <telerik:RadComboBox ID="rcb_Site" Runat="server" DataSourceID="sds_Site" DataTextField="Name" DataValueField="IDSite" AppendDataBoundItems="True" AutoPostBack="True" Height="300px" Width="250px"> <Items> <telerik:RadComboBoxItem Value = "" Text="Select" /> </Items> </telerik:RadComboBox> <table cellpadding="0" cellspacing="0" style="width: 100%"> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table> <telerik:RadGrid ID="rgd_ABIUser" runat="server" GridLines="None" AutoGenerateColumns="False" Width="700px"> <MasterTableView DataKeyNames="ID"> <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings> <RowIndicatorColumn> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn DataField="SC" HeaderText="Site" SortExpression="SC" UniqueName="SC" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ID" HeaderText="User" SortExpression="ID" UniqueName="ID" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="175px"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="PW" HeaderText="Password" SortExpression="PW" UniqueName="PW" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="175px"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="SN" HeaderText="TCH#" SortExpression="SN" UniqueName="SN" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="TG" HeaderText="Group" SortExpression="TG" UniqueName="TG" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"> </telerik:GridBoundColumn> <telerik:GridTemplateColumn UniqueName="TemplateColumn"> <ItemTemplate> <asp:Button ID="btn_ModifyPerms" runat="server" Text="Modify" onclick="btn_ModifyABIUser_Click" /> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> </telerik:RadGrid> <p> </p> <p> </p> </td> </tr> </table> </td> </tr> </table> </div> <div id="footer"> </div> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="rgd_ABIUser" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="rgd_ABIUser"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="rgd_ABIUser" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <asp:SqlDataSource ID="sds_AA_Menu" runat="server" ConnectionString="<%$ ConnectionStrings:AeriesAdmin_ConnectionString %>" SelectCommand="SELECT [DataFieldID], [DataFieldParentID], [DataTextField], [DataNavigateUrlField], [ImageURL], [UserLevel] FROM [AA_Menu] WHERE ([UserLevel] LIKE '%' + @UserLevel + '%')"> <SelectParameters> <asp:SessionParameter Name="UserLevel" SessionField="RoleName" Type="String" /> </SelectParameters> </asp:SqlDataSource> <telerik:RadScriptManager ID="rsm_AeriesAdmin" Runat="server"> </telerik:RadScriptManager> <telerik:RadFormDecorator ID="rfd_AeriesAdmin" Runat="server" Skin="WebBlue" /> <asp:SqlDataSource ID="sds_Database" runat="server" ConnectionString="<%$ ConnectionStrings:AeriesAdmin_ConnectionString %>" SelectCommand="SELECT DISTINCT [DatabaseName] FROM [vw_AA_Databases] ORDER BY [DatabaseName]"></asp:SqlDataSource> <asp:SqlDataSource ID="sds_Site" runat="server" ConnectionString="<%$ ConnectionStrings:AeriesAdmin_ConnectionString %>" SelectCommand="SELECT [IDSite], [Name] FROM [vw_ITC_Sites] ORDER BY [Name]"> </asp:SqlDataSource> <br /> <br /> </form> </body> </html> Imports System.Data Imports System.Data.SqlClient Imports Telerik.Web.UI Imports System.CodeDom Imports System.Web Imports System.Web.Security Imports System.Web.Security.Roles Imports System.Web.Security.Membership Imports System.Security Imports System.Security.Principal.WindowsIdentity Imports System.Drawing Imports System.Threading Partial Class _Default Inherits System.Web.UI.Page 'Protected Sub RadPanelBar1_DataBound1(ByVal sender As Object, ByVal e As System.EventArgs) Handles rpb_AA_Menu.DataBound ' rpb_AA_Menu.Items(0).Expanded = True ' rpb_AA_Menu.Items(1).Expanded = True 'End Sub 'Protected Sub Page_PreLoad(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreLoad ' Dim ActiveDirID As String = "ActiveDirID" ' Dim connectionString As String = DirectCast(ConfigurationManager.ConnectionStrings("AeriesAdmin_ConnectionString").ConnectionString, String) ' Dim queryString As String = "SELECT ActiveDirID, RoleName, FullName, UserName FROM vw_ADSI WHERE UserName = @UserName" ' Using myConnection As New SqlConnection(connectionString) ' Dim myCommand As New SqlCommand(queryString, myConnection) ' myConnection.Open() ' myCommand.Parameters.AddWithValue("@UserName", User.Identity.Name) ' Dim MyReader As SqlDataReader = myCommand.ExecuteReader ' MyReader.Read() ' Session("UserName") = MyReader("UserName") ' Session("ActiveDirID") = MyReader("ActiveDirID") ' Session("RoleName") = MyReader("RoleName") ' myConnection.Close() ' End Using ' End Sub '********************************************************************** 'Format combo boxes '********************************************************************** Protected Sub rcb_Site_SelectedIndexChanged(o As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles rcb_Site.SelectedIndexChanged rgd_ABIUser.DataSource = GetUser() rgd_ABIUser.DataBind() End Sub Private Function GetUser() As DataTable Dim DatabaseName As String = rcb_Database.SelectedValue Dim SC As String = rcb_Site.SelectedValue Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=XXX;PWD=XXX;") Dim command = New SqlCommand("aa_abi_users_by_site", connectionString) command.CommandType = CommandType.StoredProcedure command.Parameters.Add("@DBName", SqlDbType.VarChar).Value = DatabaseName command.Parameters.Add("@SC", SqlDbType.VarChar).Value = SC command.Connection.Open() Dim myDataAdapter As New SqlDataAdapter(command) Dim myDataSet As New DataSet Dim dtData As New DataTable myDataAdapter.Fill(myDataSet) Return myDataSet.Tables(0) command.Connection.Close() End Function Protected Sub btn_ModifyABIUser_Click(sender As Object, e As System.EventArgs) Dim ID_item As GridDataItem = DirectCast(TryCast(sender, Button).NamingContainer, GridDataItem) Dim ID As String = ID_item.OwnerTableView.DataKeyValues(ID_item.ItemIndex)("ID") Session("ID") = ID Session("DataBase") = rcb_Database.SelectedValue Session("Site") = rcb_Site.SelectedValue Dim windowManager As New RadWindowManager() Dim RadWindow As New RadWindow() RadWindow.NavigateUrl = "user_mod_modal.aspx" RadWindow.ID = "RadWindow1" RadWindow.VisibleOnPageLoad = True RadWindow.Height = 375 RadWindow.Width = 550 RadWindow.Modal = True windowManager.Windows.Add(RadWindow) Me.form1.Controls.Add(RadWindow) End Sub Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest If e.Argument = "Rebind" Then rgd_ABIUser.MasterTableView.SortExpressions.Clear() rgd_ABIUser.MasterTableView.GroupByExpressions.Clear() rgd_ABIUser.DataSource = GetUser() rgd_ABIUser.Rebind() ElseIf e.Argument = "RebindAndNavigate" Then rgd_ABIUser.MasterTableView.SortExpressions.Clear() rgd_ABIUser.MasterTableView.GroupByExpressions.Clear() rgd_ABIUser.MasterTableView.CurrentPageIndex = rgd_ABIUser.MasterTableView.PageCount - 1 rgd_ABIUser.DataSource = GetUser() rgd_ABIUser.Rebind() End If End Sub End Class<%@ Page Language="VB" AutoEventWireup="false" CodeFile="user_mod_modal.aspx.vb" Inherits="_Default" EnableEventValidation="false" %> <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Aeries Global System Manager</title> <link rel="stylesheet" type="text/css" href="~/includes/ITC_Main.css" /> <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> function CloseAndRebind(args) { GetRadWindow().BrowserWindow.refreshGrid(args); GetRadWindow().close(); } function GetRadWindow() { var oWindow = null; if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well) return oWindow; } function CancelEdit() { GetRadWindow().close(); } </script> </telerik:RadCodeBlock> </head> <body> <form id="form1" runat="server"> <div id="header"> <table cellpadding="0" cellspacing="0" style="width: 100%; height: 40px;"> <tr> <td style="width: 213px"> <img alt="" src="../../images/aalogo.gif" /></td> <td style="text-align: right"> <img alt="" src="../../images/aatusdlogo.gif" /></td> </tr> </table> </div> <div id="subheader"> </div> <div> <table cellpadding="0" cellspacing="0" style="width: 100%"> <tr> <td valign="top" style="background-color: #FFFFFF; border-bottom-style: solid; border-bottom-width: thin; border-bottom-color: #000000;"> <table cellpadding="0" cellspacing="0" style="width: 100%"> <tr> <td style="padding: 10px"> <table align="center" cellpadding="0" cellspacing="0"> <tr> <td style="font-size: large; font-weight: bold; color: #7698BA; text-align: center"> Modify ABI User Details</td> </tr> <tr> <td> <asp:Label ID="Label1" runat="server" Text="Label" style="color: #FFFFFF"></asp:Label> </td> </tr> <tr> <td> <telerik:RadGrid ID="rgd_ABIUser" runat="server" GridLines="None" AutoGenerateColumns="False" Width="400px"> <MasterTableView DataKeyNames="ID"> <RowIndicatorColumn> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <Columns> <telerik:GridTemplateColumn DataField="SC" HeaderText="Site" SortExpression="SC" UniqueName="SC"> <ItemTemplate> <asp:Label ID="Label2" runat="server" Text='<%# Bind("SC") %>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="ID" HeaderText="User" SortExpression="ID" UniqueName="ID"> <ItemTemplate> <asp:Label ID="Label3" runat="server" Text='<%# Bind("ID") %>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="PW" HeaderText="Password" SortExpression="PW" UniqueName="PW"> <ItemTemplate> <asp:TextBox ID="tbx_Password" Text='<%# Bind("PW") %>' runat="server"></asp:TextBox> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="SN" HeaderText="TCH#" SortExpression="SN" UniqueName="SN" > <ItemTemplate> <asp:TextBox ID="tbx_TchNo" Text='<%# Bind("SN") %>' runat="server" style="text-align:center;" Width="30px"></asp:TextBox> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="TG" HeaderText="Group" SortExpression="TG" UniqueName="TG"> <ItemTemplate> <asp:TextBox ID="tbx_TG" Text='<%# Bind("TG") %>' runat="server" style="text-align:center;" Width="20px"></asp:TextBox> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> </telerik:RadGrid> </td> </tr> <tr> <td style="text-align: center"> <asp:Button ID="btn_UpdateUser" OnClick="btn_UpdateUser_Click" runat="server" Text="Update" /> </td> </tr> </table> <br /> <br /> <br /> <br /> </td> </tr> </table> </td> </tr> </table> </div> <div id="footer"> </div> <telerik:RadScriptManager ID="rsm_AeriesAdmin" Runat="server"> </telerik:RadScriptManager> <br /> <br /> </form> </body> </html> Imports System.Data Imports System.Data.SqlClient Imports Telerik.Web.UI Imports System.CodeDom Imports System.Web Imports System.Web.Security Imports System.Web.Security.Roles Imports System.Web.Security.Membership Imports System.Security Imports System.Security.Principal.WindowsIdentity Partial Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then rgd_ABIUser.DataSource = GetUser() rgd_ABIUser.DataBind() End If End Sub Private Function GetUser() As DataTable Dim DatabaseName = Session("DataBase") Dim Site = Session("Site") Dim IDUser As String = Session("ID") Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=XXX;PWD=XXX;") Dim command = New SqlCommand("aa_abi_users_by_id", connectionString) command.CommandType = CommandType.StoredProcedure command.Parameters.Add("@DBName", SqlDbType.VarChar).Value = DatabaseName command.Parameters.Add("@ID", SqlDbType.VarChar).Value = IDUser command.Connection.Open() Dim myDataAdapter As New SqlDataAdapter(command) Dim myDataSet As New DataSet Dim dtData As New DataTable myDataAdapter.Fill(myDataSet) Return myDataSet.Tables(0) command.Connection.Close() End Function Protected Sub btn_UpdateUser_Click(ByVal sender As Object, ByVal e As System.EventArgs) For Each item As GridDataItem In rgd_ABIUser.MasterTableView.Items Dim tbx_Password As TextBox = DirectCast(item("PW").FindControl("tbx_Password"), TextBox) Dim PW As String = tbx_Password.Text Dim tbx_TchNo As TextBox = DirectCast(item("SN").FindControl("tbx_TchNo"), TextBox) Dim SN As String = tbx_TchNo.Text Dim tbx_TG As TextBox = DirectCast(item("TG").FindControl("tbx_TG"), TextBox) Dim TG As String = tbx_TG.Text Dim DatabaseName As String = Session("DataBase") Dim Val = Session("Site") Dim Site As Integer = Convert.ToInt32(Val) Dim IDUser As String = Session("ID") Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=XXX;PWD=XXX;") Dim command = New SqlCommand("aa_abi_users_update", connectionString) command.CommandType = CommandType.StoredProcedure command.Parameters.Add("@DBName", SqlDbType.VarChar).Value = DatabaseName command.Parameters.Add("@IDSite", SqlDbType.Int).Value = Site command.Parameters.Add("@IDUser", SqlDbType.VarChar).Value = IDUser command.Parameters.Add("@PW", SqlDbType.VarChar).Value = PW command.Parameters.Add("@SN", SqlDbType.VarChar).Value = SN command.Parameters.Add("@TG", SqlDbType.VarChar).Value = TG command.Connection.Open() command.ExecuteNonQuery() command.Connection.Close() Next If Session("DataBase") IsNot Nothing Then Session.Remove("DataBase") End If If Session("Site") IsNot Nothing Then Session.Remove("Site") End If If Session("IDUser") IsNot Nothing Then Session.Remove("IDUser") End If Label1.Text = "<script type='text/javascript'>CloseAndRebind()</" + "script>" End Sub End Class