locked
how to write the code for the buttons RRS feed

  • Question

  • User450403478 posted

    hello sir i am mohammed imran working as a software engineer,my project is on .net,while developing a website application,i got a task of placing two button on the master page and by clicking those buttons,the existing table in masterpage should change from right to left and viseversa,and while changing the table the content of the table should change into arabic and english,can any one of u plz solve my proble

    Monday, June 22, 2009 8:18 AM

Answers

All replies

  • User-925286913 posted

    If you need to translate only master page, use 2 master page for different language.

    Change the master page file in code behind in Button click.

    But, if you need to translate while application, Use globalization.

    Refer to:

    http://msdn.microsoft.com/en-us/library/c6zyy3s9.aspx

    http://www.codeproject.com/Kb/aspnet/localizationByVivekTakur.aspx

    http://weblogs.asp.net/scottgu/archive/2006/05/30/ASP.NET-2.0-Localization-_2800_Video_2C00_-Whitepaper_2C00_-and-Database-Provider-Support_2900_.aspx

    http://aspalliance.com/821

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 22, 2009 9:58 AM
  • User450403478 posted

    how to write the code for the

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 23, 2009 3:07 AM
  • User450403478 posted

    brother how to wirte the code for the button click,can i get the code of it

    Tuesday, June 23, 2009 3:08 AM
  • User450403478 posted

    i am not able to get the code with the following site which u gave me,just explai me in deatils the code for the button click

    Tuesday, June 23, 2009 3:10 AM
  • User-1136466523 posted

     Hi,

    Just as chintanpshah said, using two master pages is a good practise. Besides, you also can add Globalization&Localization feature in your code, and adding local resource with different languages for your control on your page.

    As for the table's postion, actually you can use RegisterStartupScript method to adjust the style attribute of that table element through JavaScript code. In this way, you can change the layout from the event of server side button control.

    For codes or samples, it's hard to provide the whole code according to your requirement in support forum, I suggest that you should go to QuickStarts (http://quickstarts.asp.net), it will help you further.

    Thanks.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 24, 2009 11:34 PM
  • User450403478 posted

    hello brother as this is my aspx page with whole designing and now i would like to know how to change the dirction of the table from right to left n viseversa as i am using english and arabci button,have a look over it n let me know about it,waiting for ur reply

    u can mail me at:imranwahabit@gmail.com

     

    <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="CompanyBranches.aspx.vb" Inherits="CompanyBranches" title="Untitled Page" %>

    <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
        <style type="text/css">
            .style3
            {
                height: 25px;
            }
            .style4
            {
                height: 31px;
            }
            .style5
            {
                height: 29px;
            }
        </style>
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <br />
        &nbsp;<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
       
            <table width="400px">
                <tr>
                    <td align="left">
                        <asp:Label ID="LblBranchesID" runat="server"
                            Text="<%$ Resources:Resource123, LblBranchesID %>"></asp:Label>
                    </td>
                    <td align="left" >
                        <asp:TextBox ID="TxtBranchesID" runat="server" Height="22px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblNameOfBranches" runat="server"
                            Text="<%$ Resources:Resource123, LblNameOfBranches %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="DDLForNameOfBranches" runat="server" Height="73px"
                             Width="177px" >
                            
                       
                            <asp:ListItem>Select Branches</asp:ListItem>
                            
                       
                            <asp:ListItem>Alrida</asp:ListItem>
                            <asp:ListItem>blue chips</asp:ListItem>
                            <asp:ListItem>golden bird technologies</asp:ListItem>
                            
                       
                            <asp:ListItem></asp:ListItem>
                            
                       
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RFVnameofbranches" runat="server"
                            ControlToValidate="DDLForNameOfBranches"
                            ErrorMessage="&lt;b&gt;Required Field Missing&lt;/b&gt;&lt;br/&gt;Name of the branches is Required"
                            InitialValue="Select Branches">*</asp:RequiredFieldValidator>
                        <cc1:ValidatorCalloutExtender ID="RFVnameofbranches_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RFVnameofbranches">
                        </cc1:ValidatorCalloutExtender>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblCities" runat="server"
                            Text="<%$ Resources:Resource123, LblCities %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="DDLforCities" runat="server" Height="68px"
                            DataSourceID="SqlDataSource4" DataTextField="EnglishName" Width="150px">
                        </asp:DropDownList>
                       
                        <%--<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                            ErrorMessage="RequiredFieldValidator" InitialValue="Select">*</asp:RequiredFieldValidator>--%>
                           
                        <asp:SqlDataSource ID="SqlDataSource4" runat="server"
                            ConnectionString="<%$ ConnectionStrings:RidaItConnectionString %>"
                            SelectCommand="SELECT [CityCode], [ArabicName], [EnglishName] FROM [CitiesData]">
                        </asp:SqlDataSource>
                       
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblAddress" runat="server"
                            Text="<%$ Resources:Resource123, LblAddress %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtAddress" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                            ControlToValidate="TxtAddress"
                            ErrorMessage="&lt;b&gt;Required Field Missing&lt;/b&gt;&lt;br/&gt;Address is Required">*</asp:RequiredFieldValidator>
                        <cc1:ValidatorCalloutExtender ID="RequiredFieldValidator1_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RequiredFieldValidator1">
                        </cc1:ValidatorCalloutExtender>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblTelephone" runat="server"
                            Text="<%$ Resources:Resource123, LblTelephone %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtTelephone" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                            ControlToValidate="TxtTelephone"
                            ErrorMessage="&lt;b&gt;Required Field Missing&lt;/b&gt;&lt;br/&gt;Telephone number  is Required">*</asp:RequiredFieldValidator>
                        <cc1:ValidatorCalloutExtender ID="RequiredFieldValidator2_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RequiredFieldValidator2">
                        </cc1:ValidatorCalloutExtender>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblMobile" runat="server"
                            Text="<%$ Resources:Resource123, LblMobile %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtMobile" runat="server" Width="128px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RFVformobile" runat="server"
                            ControlToValidate="TxtMobile"
                            ErrorMessage="&lt;b&gt;Required Field Missing&lt;/b&gt;&lt;br/&gt;Mobile number  is Required">*</asp:RequiredFieldValidator>
                        <cc1:ValidatorCalloutExtender ID="RFVformobile_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RFVformobile">
                        </cc1:ValidatorCalloutExtender>
                        <br />
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblFax" runat="server"
                            Text="<%$ Resources:Resource123, LblFax %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtFax" runat="server" Height="22px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblEmail" runat="server"
                            Text="<%$ Resources:Resource123, LblEmail %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtEmail" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                            ControlToValidate="TxtEmail"
                            ErrorMessage="&lt;b&gt;Email field is missing&lt;/b&gt;&lt;br/&gt;Enter Your emailid">*</asp:RequiredFieldValidator>
                        <cc1:ValidatorCalloutExtender ID="RequiredFieldValidator3_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RequiredFieldValidator3">
                        </cc1:ValidatorCalloutExtender>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                            ControlToValidate="TxtEmail"
                            ErrorMessage="&lt;b&gt;Enter correct format&lt;/b&gt;&lt;br/&gt;Ex:imran@Gmail.com"
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">#</asp:RegularExpressionValidator>
                        <cc1:ValidatorCalloutExtender ID="RegularExpressionValidator1_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RegularExpressionValidator1">
                        </cc1:ValidatorCalloutExtender>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblPOBox" runat="server"
                            Text="<%$ Resources:Resource123, LblPOBox %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtPOBox" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <asp:Label ID="LblMSg" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                      
                        <asp:Button ID="BtnSave" runat="server" Text="Save" Width="64px"
                            BackColor="#FF9900" BorderColor="Black" />
                        <asp:Button ID="BtnEdit" runat="server" Text="Edit" Width="64px"
                            BackColor="#FF9900" BorderColor="Black" style="height: 26px" />
                        <asp:Button ID="BtnClear" runat="server" Text="Clear" Width="64px"
                            BackColor="#FF9900" BorderColor="Black" />
                        <asp:Button ID="BtnSearch" runat="server" Text="Search" Width="64px"
                            BackColor="#FF9900" BorderColor="Black" />
                        <asp:Button ID="BtnDelete" runat="server" Text="Delete" BackColor="#FF9900"
                            BorderColor="Black" style="height: 26px" />
                         <cc1:DropShadowExtender ID="DropShadowExtender1" runat="server" TargetControlID="BtnSave">
                        </cc1:DropShadowExtender>
                        <cc1:DropShadowExtender ID="DropShadowExtender2" runat="server" TargetControlID="BtnEdit">
                        </cc1:DropShadowExtender>
                        <cc1:DropShadowExtender ID="DropShadowExtender3" runat="server" TargetControlID="BtnClear">
                        </cc1:DropShadowExtender>
                        <cc1:DropShadowExtender ID="DropShadowExtender4" runat="server" TargetControlID="BtnSearch">
                        </cc1:DropShadowExtender>
                        <cc1:DropShadowExtender ID="DropShadowExtender5" runat="server" TargetControlID="BtnDelete">
                        </cc1:DropShadowExtender>
                        <asp:SqlDataSource ID="SqlDataSource2" runat="server"
                            ConnectionString="<%$ ConnectionStrings:RidaItConnectionString %>"
                            DeleteCommand="DELETE FROM CompanyBranches WHERE (BranchesID = @BranchesID)"
                            InsertCommand="INSERT INTO CompanyBranches(NameOfBranches, Cities, Address, Telephone, Mobile, Fax, Email, POBox) VALUES (@NameOFBranches, @Cities, @Address, @Telephone, @Mobile, @Fax, @Email, @POBox)"
                            SelectCommand="SELECT * FROM [CompanyBranches]"
                           
                            UpdateCommand="UPDATE CompanyBranches SET Fax = @Fax, Mobile = @Mobile, Cities = @Cities, NameOfBranches = @NameOfBranches, Address = @Address, Telephone = @Telephone, Email = @Email, POBox = @POBox  Where(BranchesID=@BranchesID)">
                            <DeleteParameters>
                                <asp:SessionParameter Name="BranchesID" SessionField="id" />
                            </DeleteParameters>
                            <UpdateParameters>
                                <asp:ControlParameter ControlID="TxtFax" Name="Fax" PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtMobile" Name="Mobile" PropertyName="Text" />
                                <asp:ControlParameter ControlID="DDLforCities" Name="Cities"
                                    PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="DDLForNameOfBranches" Name="NameOfBranches"
                                    PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="TxtAddress" Name="Address"
                                    PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtTelephone" Name="Telephone"
                                    PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtEmail" Name="Email" PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtPOBox" Name="POBox" PropertyName="Text" />
                                <asp:SessionParameter Name="BranchesID" SessionField="id" />
                            </UpdateParameters>
                            <InsertParameters>
                                <asp:ControlParameter ControlID="DDLForNameOfBranches" Name="NameOFBranches"
                                    PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="DDLforCities" Name="Cities"
                                    PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="TxtAddress" Name="Address"
                                    PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtTelephone" Name="Telephone"
                                    PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtMobile" Name="Mobile" PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtFax" Name="Fax" PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtEmail" Name="Email" PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtPOBox" Name="POBox" PropertyName="Text" />
                            </InsertParameters>
                        </asp:SqlDataSource>
                    </td>
                </tr>
                <tr>
                    <td align="left" colspan="2">
                        <asp:GridView ID="GridView1" runat="server" AllowPaging="True"
                            AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="BranchesID"
                            DataSourceID="SqlDataSource1" CellPadding="4" ForeColor="#333333"
                            GridLines="None">
                            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                            <Columns>
                                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True"
                                    ShowSelectButton="True" />
                                <asp:BoundField DataField="BranchesID" HeaderText="BranchesID" ReadOnly="True"
                                    SortExpression="BranchesID" />
                                <asp:BoundField DataField="NameOfBranches" HeaderText="NameOfBranches"
                                    SortExpression="NameOfBranches" />
                                <asp:BoundField DataField="Cities" HeaderText="Cities"
                                    SortExpression="Cities" />
                                <asp:BoundField DataField="Address" HeaderText="Address"
                                    SortExpression="Address" />
                                <asp:BoundField DataField="Telephone" HeaderText="Telephone"
                                    SortExpression="Telephone" />
                                <asp:BoundField DataField="Mobile" HeaderText="Mobile"
                                    SortExpression="Mobile" />
                                <asp:BoundField DataField="Fax" HeaderText="Fax" SortExpression="Fax" />
                                <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                                <asp:BoundField DataField="POBox" HeaderText="POBox" SortExpression="POBox" />
                            </Columns>
                            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                            ConflictDetection="CompareAllValues"
                            ConnectionString="<%$ ConnectionStrings:RidaItConnectionString %>"
                            DeleteCommand="DELETE FROM [CompanyBranches] WHERE [BranchesID] = @original_BranchesID AND [NameOfBranches] = @original_NameOfBranches AND [Cities] = @original_Cities AND [Address] = @original_Address AND [Telephone] = @original_Telephone AND [Mobile] = @original_Mobile AND [Fax] = @original_Fax AND [Email] = @original_Email AND [POBox] = @original_POBox"
                            InsertCommand="INSERT INTO [CompanyBranches] ([BranchesID], [NameOfBranches], [Cities], [Address], [Telephone], [Mobile], [Fax], [Email], [POBox]) VALUES (@BranchesID, @NameOfBranches, @Cities, @Address, @Telephone, @Mobile, @Fax, @Email, @POBox)"
                            OldValuesParameterFormatString="original_{0}"
                            SelectCommand="SELECT * FROM [CompanyBranches]"
                            UpdateCommand="UPDATE [CompanyBranches] SET [NameOfBranches] = @NameOfBranches, [Cities] = @Cities, [Address] = @Address, [Telephone] = @Telephone, [Mobile] = @Mobile, [Fax] = @Fax, [Email] = @Email, [POBox] = @POBox WHERE [BranchesID] = @original_BranchesID AND [NameOfBranches] = @original_NameOfBranches AND [Cities] = @original_Cities AND [Address] = @original_Address AND [Telephone] = @original_Telephone AND [Mobile] = @original_Mobile AND [Fax] = @original_Fax AND [Email] = @original_Email AND [POBox] = @original_POBox">
                            <DeleteParameters>
                                <asp:Parameter Name="original_BranchesID" Type="Object" />
                                <asp:Parameter Name="original_NameOfBranches" Type="String" />
                                <asp:Parameter Name="original_Cities" Type="String" />
                                <asp:Parameter Name="original_Address" Type="String" />
                                <asp:Parameter Name="original_Telephone" Type="Int32" />
                                <asp:Parameter Name="original_Mobile" Type="Int32" />
                                <asp:Parameter Name="original_Fax" Type="Int32" />
                                <asp:Parameter Name="original_Email" Type="String" />
                                <asp:Parameter Name="original_POBox" Type="Int32" />
                            </DeleteParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="NameOfBranches" Type="String" />
                                <asp:Parameter Name="Cities" Type="String" />
                                <asp:Parameter Name="Address" Type="String" />
                                <asp:Parameter Name="Telephone" Type="Int32" />
                                <asp:Parameter Name="Mobile" Type="Int32" />
                                <asp:Parameter Name="Fax" Type="Int32" />
                                <asp:Parameter Name="Email" Type="String" />
                                <asp:Parameter Name="POBox" Type="Int32" />
                                <asp:Parameter Name="original_BranchesID" Type="Object" />
                                <asp:Parameter Name="original_NameOfBranches" Type="String" />
                                <asp:Parameter Name="original_Cities" Type="String" />
                                <asp:Parameter Name="original_Address" Type="String" />
                                <asp:Parameter Name="original_Telephone" Type="Int32" />
                                <asp:Parameter Name="original_Mobile" Type="Int32" />
                                <asp:Parameter Name="original_Fax" Type="Int32" />
                                <asp:Parameter Name="original_Email" Type="String" />
                                <asp:Parameter Name="original_POBox" Type="Int32" />
                            </UpdateParameters>
                            <InsertParameters>
                                <asp:Parameter Name="BranchesID" Type="Object" />
                                <asp:Parameter Name="NameOfBranches" Type="String" />
                                <asp:Parameter Name="Cities" Type="String" />
                                <asp:Parameter Name="Address" Type="String" />
                                <asp:Parameter Name="Telephone" Type="Int32" />
                                <asp:Parameter Name="Mobile" Type="Int32" />
                                <asp:Parameter Name="Fax" Type="Int32" />
                                <asp:Parameter Name="Email" Type="String" />
                                <asp:Parameter Name="POBox" Type="Int32" />
                            </InsertParameters>
                        </asp:SqlDataSource>
                    </td>
                </tr>
            </table>
       
        </ContentTemplate>
        </asp:UpdatePanel>
    </asp:Content>

     

    Saturday, January 9, 2010 3:36 AM
  • User450403478 posted

    hello brother as this is my aspx page with whole designing and now i would like to know how to change the dirction of the table from right to left n viseversa as i am using english and arabci button,have a look over it n let me know about it,waiting for ur reply

    u can mail me at:imranwahabit@gmail.com

     

    <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="CompanyBranches.aspx.vb" Inherits="CompanyBranches" title="Untitled Page" %>

    <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
        <style type="text/css">
            .style3
            {
                height: 25px;
            }
            .style4
            {
                height: 31px;
            }
            .style5
            {
                height: 29px;
            }
        </style>
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <br />
        &nbsp;<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
       
            <table width="400px">
                <tr>
                    <td align="left">
                        <asp:Label ID="LblBranchesID" runat="server"
                            Text="<%$ Resources:Resource123, LblBranchesID %>"></asp:Label>
                    </td>
                    <td align="left" >
                        <asp:TextBox ID="TxtBranchesID" runat="server" Height="22px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblNameOfBranches" runat="server"
                            Text="<%$ Resources:Resource123, LblNameOfBranches %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="DDLForNameOfBranches" runat="server" Height="73px"
                             Width="177px" >
                            
                       
                            <asp:ListItem>Select Branches</asp:ListItem>
                            
                       
                            <asp:ListItem>Alrida</asp:ListItem>
                            <asp:ListItem>blue chips</asp:ListItem>
                            <asp:ListItem>golden bird technologies</asp:ListItem>
                            
                       
                            <asp:ListItem></asp:ListItem>
                            
                       
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RFVnameofbranches" runat="server"
                            ControlToValidate="DDLForNameOfBranches"
                            ErrorMessage="&lt;b&gt;Required Field Missing&lt;/b&gt;&lt;br/&gt;Name of the branches is Required"
                            InitialValue="Select Branches">*</asp:RequiredFieldValidator>
                        <cc1:ValidatorCalloutExtender ID="RFVnameofbranches_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RFVnameofbranches">
                        </cc1:ValidatorCalloutExtender>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblCities" runat="server"
                            Text="<%$ Resources:Resource123, LblCities %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="DDLforCities" runat="server" Height="68px"
                            DataSourceID="SqlDataSource4" DataTextField="EnglishName" Width="150px">
                        </asp:DropDownList>
                       
                        <%--<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                            ErrorMessage="RequiredFieldValidator" InitialValue="Select">*</asp:RequiredFieldValidator>--%>
                           
                        <asp:SqlDataSource ID="SqlDataSource4" runat="server"
                            ConnectionString="<%$ ConnectionStrings:RidaItConnectionString %>"
                            SelectCommand="SELECT [CityCode], [ArabicName], [EnglishName] FROM [CitiesData]">
                        </asp:SqlDataSource>
                       
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblAddress" runat="server"
                            Text="<%$ Resources:Resource123, LblAddress %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtAddress" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                            ControlToValidate="TxtAddress"
                            ErrorMessage="&lt;b&gt;Required Field Missing&lt;/b&gt;&lt;br/&gt;Address is Required">*</asp:RequiredFieldValidator>
                        <cc1:ValidatorCalloutExtender ID="RequiredFieldValidator1_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RequiredFieldValidator1">
                        </cc1:ValidatorCalloutExtender>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblTelephone" runat="server"
                            Text="<%$ Resources:Resource123, LblTelephone %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtTelephone" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                            ControlToValidate="TxtTelephone"
                            ErrorMessage="&lt;b&gt;Required Field Missing&lt;/b&gt;&lt;br/&gt;Telephone number  is Required">*</asp:RequiredFieldValidator>
                        <cc1:ValidatorCalloutExtender ID="RequiredFieldValidator2_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RequiredFieldValidator2">
                        </cc1:ValidatorCalloutExtender>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblMobile" runat="server"
                            Text="<%$ Resources:Resource123, LblMobile %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtMobile" runat="server" Width="128px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RFVformobile" runat="server"
                            ControlToValidate="TxtMobile"
                            ErrorMessage="&lt;b&gt;Required Field Missing&lt;/b&gt;&lt;br/&gt;Mobile number  is Required">*</asp:RequiredFieldValidator>
                        <cc1:ValidatorCalloutExtender ID="RFVformobile_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RFVformobile">
                        </cc1:ValidatorCalloutExtender>
                        <br />
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblFax" runat="server"
                            Text="<%$ Resources:Resource123, LblFax %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtFax" runat="server" Height="22px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblEmail" runat="server"
                            Text="<%$ Resources:Resource123, LblEmail %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtEmail" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                            ControlToValidate="TxtEmail"
                            ErrorMessage="&lt;b&gt;Email field is missing&lt;/b&gt;&lt;br/&gt;Enter Your emailid">*</asp:RequiredFieldValidator>
                        <cc1:ValidatorCalloutExtender ID="RequiredFieldValidator3_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RequiredFieldValidator3">
                        </cc1:ValidatorCalloutExtender>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                            ControlToValidate="TxtEmail"
                            ErrorMessage="&lt;b&gt;Enter correct format&lt;/b&gt;&lt;br/&gt;Ex:imran@Gmail.com"
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">#</asp:RegularExpressionValidator>
                        <cc1:ValidatorCalloutExtender ID="RegularExpressionValidator1_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RegularExpressionValidator1">
                        </cc1:ValidatorCalloutExtender>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblPOBox" runat="server"
                            Text="<%$ Resources:Resource123, LblPOBox %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtPOBox" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <asp:Label ID="LblMSg" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                      
                        <asp:Button ID="BtnSave" runat="server" Text="Save" Width="64px"
                            BackColor="#FF9900" BorderColor="Black" />
                        <asp:Button ID="BtnEdit" runat="server" Text="Edit" Width="64px"
                            BackColor="#FF9900" BorderColor="Black" style="height: 26px" />
                        <asp:Button ID="BtnClear" runat="server" Text="Clear" Width="64px"
                            BackColor="#FF9900" BorderColor="Black" />
                        <asp:Button ID="BtnSearch" runat="server" Text="Search" Width="64px"
                            BackColor="#FF9900" BorderColor="Black" />
                        <asp:Button ID="BtnDelete" runat="server" Text="Delete" BackColor="#FF9900"
                            BorderColor="Black" style="height: 26px" />
                         <cc1:DropShadowExtender ID="DropShadowExtender1" runat="server" TargetControlID="BtnSave">
                        </cc1:DropShadowExtender>
                        <cc1:DropShadowExtender ID="DropShadowExtender2" runat="server" TargetControlID="BtnEdit">
                        </cc1:DropShadowExtender>
                        <cc1:DropShadowExtender ID="DropShadowExtender3" runat="server" TargetControlID="BtnClear">
                        </cc1:DropShadowExtender>
                        <cc1:DropShadowExtender ID="DropShadowExtender4" runat="server" TargetControlID="BtnSearch">
                        </cc1:DropShadowExtender>
                        <cc1:DropShadowExtender ID="DropShadowExtender5" runat="server" TargetControlID="BtnDelete">
                        </cc1:DropShadowExtender>
                        <asp:SqlDataSource ID="SqlDataSource2" runat="server"
                            ConnectionString="<%$ ConnectionStrings:RidaItConnectionString %>"
                            DeleteCommand="DELETE FROM CompanyBranches WHERE (BranchesID = @BranchesID)"
                            InsertCommand="INSERT INTO CompanyBranches(NameOfBranches, Cities, Address, Telephone, Mobile, Fax, Email, POBox) VALUES (@NameOFBranches, @Cities, @Address, @Telephone, @Mobile, @Fax, @Email, @POBox)"
                            SelectCommand="SELECT * FROM [CompanyBranches]"
                           
                            UpdateCommand="UPDATE CompanyBranches SET Fax = @Fax, Mobile = @Mobile, Cities = @Cities, NameOfBranches = @NameOfBranches, Address = @Address, Telephone = @Telephone, Email = @Email, POBox = @POBox  Where(BranchesID=@BranchesID)">
                            <DeleteParameters>
                                <asp:SessionParameter Name="BranchesID" SessionField="id" />
                            </DeleteParameters>
                            <UpdateParameters>
                                <asp:ControlParameter ControlID="TxtFax" Name="Fax" PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtMobile" Name="Mobile" PropertyName="Text" />
                                <asp:ControlParameter ControlID="DDLforCities" Name="Cities"
                                    PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="DDLForNameOfBranches" Name="NameOfBranches"
                                    PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="TxtAddress" Name="Address"
                                    PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtTelephone" Name="Telephone"
                                    PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtEmail" Name="Email" PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtPOBox" Name="POBox" PropertyName="Text" />
                                <asp:SessionParameter Name="BranchesID" SessionField="id" />
                            </UpdateParameters>
                            <InsertParameters>
                                <asp:ControlParameter ControlID="DDLForNameOfBranches" Name="NameOFBranches"
                                    PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="DDLforCities" Name="Cities"
                                    PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="TxtAddress" Name="Address"
                                    PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtTelephone" Name="Telephone"
                                    PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtMobile" Name="Mobile" PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtFax" Name="Fax" PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtEmail" Name="Email" PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtPOBox" Name="POBox" PropertyName="Text" />
                            </InsertParameters>
                        </asp:SqlDataSource>
                    </td>
                </tr>
                <tr>
                    <td align="left" colspan="2">
                        <asp:GridView ID="GridView1" runat="server" AllowPaging="True"
                            AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="BranchesID"
                            DataSourceID="SqlDataSource1" CellPadding="4" ForeColor="#333333"
                            GridLines="None">
                            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                            <Columns>
                                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True"
                                    ShowSelectButton="True" />
                                <asp:BoundField DataField="BranchesID" HeaderText="BranchesID" ReadOnly="True"
                                    SortExpression="BranchesID" />
                                <asp:BoundField DataField="NameOfBranches" HeaderText="NameOfBranches"
                                    SortExpression="NameOfBranches" />
                                <asp:BoundField DataField="Cities" HeaderText="Cities"
                                    SortExpression="Cities" />
                                <asp:BoundField DataField="Address" HeaderText="Address"
                                    SortExpression="Address" />
                                <asp:BoundField DataField="Telephone" HeaderText="Telephone"
                                    SortExpression="Telephone" />
                                <asp:BoundField DataField="Mobile" HeaderText="Mobile"
                                    SortExpression="Mobile" />
                                <asp:BoundField DataField="Fax" HeaderText="Fax" SortExpression="Fax" />
                                <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                                <asp:BoundField DataField="POBox" HeaderText="POBox" SortExpression="POBox" />
                            </Columns>
                            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                            ConflictDetection="CompareAllValues"
                            ConnectionString="<%$ ConnectionStrings:RidaItConnectionString %>"
                            DeleteCommand="DELETE FROM [CompanyBranches] WHERE [BranchesID] = @original_BranchesID AND [NameOfBranches] = @original_NameOfBranches AND [Cities] = @original_Cities AND [Address] = @original_Address AND [Telephone] = @original_Telephone AND [Mobile] = @original_Mobile AND [Fax] = @original_Fax AND [Email] = @original_Email AND [POBox] = @original_POBox"
                            InsertCommand="INSERT INTO [CompanyBranches] ([BranchesID], [NameOfBranches], [Cities], [Address], [Telephone], [Mobile], [Fax], [Email], [POBox]) VALUES (@BranchesID, @NameOfBranches, @Cities, @Address, @Telephone, @Mobile, @Fax, @Email, @POBox)"
                            OldValuesParameterFormatString="original_{0}"
                            SelectCommand="SELECT * FROM [CompanyBranches]"
                            UpdateCommand="UPDATE [CompanyBranches] SET [NameOfBranches] = @NameOfBranches, [Cities] = @Cities, [Address] = @Address, [Telephone] = @Telephone, [Mobile] = @Mobile, [Fax] = @Fax, [Email] = @Email, [POBox] = @POBox WHERE [BranchesID] = @original_BranchesID AND [NameOfBranches] = @original_NameOfBranches AND [Cities] = @original_Cities AND [Address] = @original_Address AND [Telephone] = @original_Telephone AND [Mobile] = @original_Mobile AND [Fax] = @original_Fax AND [Email] = @original_Email AND [POBox] = @original_POBox">
                            <DeleteParameters>
                                <asp:Parameter Name="original_BranchesID" Type="Object" />
                                <asp:Parameter Name="original_NameOfBranches" Type="String" />
                                <asp:Parameter Name="original_Cities" Type="String" />
                                <asp:Parameter Name="original_Address" Type="String" />
                                <asp:Parameter Name="original_Telephone" Type="Int32" />
                                <asp:Parameter Name="original_Mobile" Type="Int32" />
                                <asp:Parameter Name="original_Fax" Type="Int32" />
                                <asp:Parameter Name="original_Email" Type="String" />
                                <asp:Parameter Name="original_POBox" Type="Int32" />
                            </DeleteParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="NameOfBranches" Type="String" />
                                <asp:Parameter Name="Cities" Type="String" />
                                <asp:Parameter Name="Address" Type="String" />
                                <asp:Parameter Name="Telephone" Type="Int32" />
                                <asp:Parameter Name="Mobile" Type="Int32" />
                                <asp:Parameter Name="Fax" Type="Int32" />
                                <asp:Parameter Name="Email" Type="String" />
                                <asp:Parameter Name="POBox" Type="Int32" />
                                <asp:Parameter Name="original_BranchesID" Type="Object" />
                                <asp:Parameter Name="original_NameOfBranches" Type="String" />
                                <asp:Parameter Name="original_Cities" Type="String" />
                                <asp:Parameter Name="original_Address" Type="String" />
                                <asp:Parameter Name="original_Telephone" Type="Int32" />
                                <asp:Parameter Name="original_Mobile" Type="Int32" />
                                <asp:Parameter Name="original_Fax" Type="Int32" />
                                <asp:Parameter Name="original_Email" Type="String" />
                                <asp:Parameter Name="original_POBox" Type="Int32" />
                            </UpdateParameters>
                            <InsertParameters>
                                <asp:Parameter Name="BranchesID" Type="Object" />
                                <asp:Parameter Name="NameOfBranches" Type="String" />
                                <asp:Parameter Name="Cities" Type="String" />
                                <asp:Parameter Name="Address" Type="String" />
                                <asp:Parameter Name="Telephone" Type="Int32" />
                                <asp:Parameter Name="Mobile" Type="Int32" />
                                <asp:Parameter Name="Fax" Type="Int32" />
                                <asp:Parameter Name="Email" Type="String" />
                                <asp:Parameter Name="POBox" Type="Int32" />
                            </InsertParameters>
                        </asp:SqlDataSource>
                    </td>
                </tr>
            </table>
       
        </ContentTemplate>
        </asp:UpdatePanel>
    </asp:Content>

     

    Saturday, January 9, 2010 3:39 AM
  • User450403478 posted

    hello brother as this is my aspx page with whole designing and now i would like to know how to change the dirction of the table from right to left n viseversa as i am using english and arabci button,have a look over it n let me know about it,waiting for ur reply

    u can mail me at:imranwahabit@gmail.com

     

    <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="CompanyBranches.aspx.vb" Inherits="CompanyBranches" title="Untitled Page" %>

    <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
        <style type="text/css">
            .style3
            {
                height: 25px;
            }
            .style4
            {
                height: 31px;
            }
            .style5
            {
                height: 29px;
            }
        </style>
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <br />
        &nbsp;<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
       
            <table width="400px">
                <tr>
                    <td align="left">
                        <asp:Label ID="LblBranchesID" runat="server"
                            Text="<%$ Resources:Resource123, LblBranchesID %>"></asp:Label>
                    </td>
                    <td align="left" >
                        <asp:TextBox ID="TxtBranchesID" runat="server" Height="22px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblNameOfBranches" runat="server"
                            Text="<%$ Resources:Resource123, LblNameOfBranches %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="DDLForNameOfBranches" runat="server" Height="73px"
                             Width="177px" >
                            
                       
                            <asp:ListItem>Select Branches</asp:ListItem>
                            
                       
                            <asp:ListItem>Alrida</asp:ListItem>
                            <asp:ListItem>blue chips</asp:ListItem>
                            <asp:ListItem>golden bird technologies</asp:ListItem>
                            
                       
                            <asp:ListItem></asp:ListItem>
                            
                       
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RFVnameofbranches" runat="server"
                            ControlToValidate="DDLForNameOfBranches"
                            ErrorMessage="&lt;b&gt;Required Field Missing&lt;/b&gt;&lt;br/&gt;Name of the branches is Required"
                            InitialValue="Select Branches">*</asp:RequiredFieldValidator>
                        <cc1:ValidatorCalloutExtender ID="RFVnameofbranches_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RFVnameofbranches">
                        </cc1:ValidatorCalloutExtender>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblCities" runat="server"
                            Text="<%$ Resources:Resource123, LblCities %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="DDLforCities" runat="server" Height="68px"
                            DataSourceID="SqlDataSource4" DataTextField="EnglishName" Width="150px">
                        </asp:DropDownList>
                       
                        <%--<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                            ErrorMessage="RequiredFieldValidator" InitialValue="Select">*</asp:RequiredFieldValidator>--%>
                           
                        <asp:SqlDataSource ID="SqlDataSource4" runat="server"
                            ConnectionString="<%$ ConnectionStrings:RidaItConnectionString %>"
                            SelectCommand="SELECT [CityCode], [ArabicName], [EnglishName] FROM [CitiesData]">
                        </asp:SqlDataSource>
                       
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblAddress" runat="server"
                            Text="<%$ Resources:Resource123, LblAddress %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtAddress" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                            ControlToValidate="TxtAddress"
                            ErrorMessage="&lt;b&gt;Required Field Missing&lt;/b&gt;&lt;br/&gt;Address is Required">*</asp:RequiredFieldValidator>
                        <cc1:ValidatorCalloutExtender ID="RequiredFieldValidator1_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RequiredFieldValidator1">
                        </cc1:ValidatorCalloutExtender>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblTelephone" runat="server"
                            Text="<%$ Resources:Resource123, LblTelephone %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtTelephone" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                            ControlToValidate="TxtTelephone"
                            ErrorMessage="&lt;b&gt;Required Field Missing&lt;/b&gt;&lt;br/&gt;Telephone number  is Required">*</asp:RequiredFieldValidator>
                        <cc1:ValidatorCalloutExtender ID="RequiredFieldValidator2_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RequiredFieldValidator2">
                        </cc1:ValidatorCalloutExtender>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblMobile" runat="server"
                            Text="<%$ Resources:Resource123, LblMobile %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtMobile" runat="server" Width="128px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RFVformobile" runat="server"
                            ControlToValidate="TxtMobile"
                            ErrorMessage="&lt;b&gt;Required Field Missing&lt;/b&gt;&lt;br/&gt;Mobile number  is Required">*</asp:RequiredFieldValidator>
                        <cc1:ValidatorCalloutExtender ID="RFVformobile_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RFVformobile">
                        </cc1:ValidatorCalloutExtender>
                        <br />
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblFax" runat="server"
                            Text="<%$ Resources:Resource123, LblFax %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtFax" runat="server" Height="22px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblEmail" runat="server"
                            Text="<%$ Resources:Resource123, LblEmail %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtEmail" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                            ControlToValidate="TxtEmail"
                            ErrorMessage="&lt;b&gt;Email field is missing&lt;/b&gt;&lt;br/&gt;Enter Your emailid">*</asp:RequiredFieldValidator>
                        <cc1:ValidatorCalloutExtender ID="RequiredFieldValidator3_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RequiredFieldValidator3">
                        </cc1:ValidatorCalloutExtender>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                            ControlToValidate="TxtEmail"
                            ErrorMessage="&lt;b&gt;Enter correct format&lt;/b&gt;&lt;br/&gt;Ex:imran@Gmail.com"
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">#</asp:RegularExpressionValidator>
                        <cc1:ValidatorCalloutExtender ID="RegularExpressionValidator1_ValidatorCalloutExtender"
                            runat="server" TargetControlID="RegularExpressionValidator1">
                        </cc1:ValidatorCalloutExtender>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="LblPOBox" runat="server"
                            Text="<%$ Resources:Resource123, LblPOBox %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TxtPOBox" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <asp:Label ID="LblMSg" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                      
                        <asp:Button ID="BtnSave" runat="server" Text="Save" Width="64px"
                            BackColor="#FF9900" BorderColor="Black" />
                        <asp:Button ID="BtnEdit" runat="server" Text="Edit" Width="64px"
                            BackColor="#FF9900" BorderColor="Black" style="height: 26px" />
                        <asp:Button ID="BtnClear" runat="server" Text="Clear" Width="64px"
                            BackColor="#FF9900" BorderColor="Black" />
                        <asp:Button ID="BtnSearch" runat="server" Text="Search" Width="64px"
                            BackColor="#FF9900" BorderColor="Black" />
                        <asp:Button ID="BtnDelete" runat="server" Text="Delete" BackColor="#FF9900"
                            BorderColor="Black" style="height: 26px" />
                         <cc1:DropShadowExtender ID="DropShadowExtender1" runat="server" TargetControlID="BtnSave">
                        </cc1:DropShadowExtender>
                        <cc1:DropShadowExtender ID="DropShadowExtender2" runat="server" TargetControlID="BtnEdit">
                        </cc1:DropShadowExtender>
                        <cc1:DropShadowExtender ID="DropShadowExtender3" runat="server" TargetControlID="BtnClear">
                        </cc1:DropShadowExtender>
                        <cc1:DropShadowExtender ID="DropShadowExtender4" runat="server" TargetControlID="BtnSearch">
                        </cc1:DropShadowExtender>
                        <cc1:DropShadowExtender ID="DropShadowExtender5" runat="server" TargetControlID="BtnDelete">
                        </cc1:DropShadowExtender>
                        <asp:SqlDataSource ID="SqlDataSource2" runat="server"
                            ConnectionString="<%$ ConnectionStrings:RidaItConnectionString %>"
                            DeleteCommand="DELETE FROM CompanyBranches WHERE (BranchesID = @BranchesID)"
                            InsertCommand="INSERT INTO CompanyBranches(NameOfBranches, Cities, Address, Telephone, Mobile, Fax, Email, POBox) VALUES (@NameOFBranches, @Cities, @Address, @Telephone, @Mobile, @Fax, @Email, @POBox)"
                            SelectCommand="SELECT * FROM [CompanyBranches]"
                           
                            UpdateCommand="UPDATE CompanyBranches SET Fax = @Fax, Mobile = @Mobile, Cities = @Cities, NameOfBranches = @NameOfBranches, Address = @Address, Telephone = @Telephone, Email = @Email, POBox = @POBox  Where(BranchesID=@BranchesID)">
                            <DeleteParameters>
                                <asp:SessionParameter Name="BranchesID" SessionField="id" />
                            </DeleteParameters>
                            <UpdateParameters>
                                <asp:ControlParameter ControlID="TxtFax" Name="Fax" PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtMobile" Name="Mobile" PropertyName="Text" />
                                <asp:ControlParameter ControlID="DDLforCities" Name="Cities"
                                    PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="DDLForNameOfBranches" Name="NameOfBranches"
                                    PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="TxtAddress" Name="Address"
                                    PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtTelephone" Name="Telephone"
                                    PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtEmail" Name="Email" PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtPOBox" Name="POBox" PropertyName="Text" />
                                <asp:SessionParameter Name="BranchesID" SessionField="id" />
                            </UpdateParameters>
                            <InsertParameters>
                                <asp:ControlParameter ControlID="DDLForNameOfBranches" Name="NameOFBranches"
                                    PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="DDLforCities" Name="Cities"
                                    PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="TxtAddress" Name="Address"
                                    PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtTelephone" Name="Telephone"
                                    PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtMobile" Name="Mobile" PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtFax" Name="Fax" PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtEmail" Name="Email" PropertyName="Text" />
                                <asp:ControlParameter ControlID="TxtPOBox" Name="POBox" PropertyName="Text" />
                            </InsertParameters>
                        </asp:SqlDataSource>
                    </td>
                </tr>
                <tr>
                    <td align="left" colspan="2">
                        <asp:GridView ID="GridView1" runat="server" AllowPaging="True"
                            AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="BranchesID"
                            DataSourceID="SqlDataSource1" CellPadding="4" ForeColor="#333333"
                            GridLines="None">
                            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                            <Columns>
                                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True"
                                    ShowSelectButton="True" />
                                <asp:BoundField DataField="BranchesID" HeaderText="BranchesID" ReadOnly="True"
                                    SortExpression="BranchesID" />
                                <asp:BoundField DataField="NameOfBranches" HeaderText="NameOfBranches"
                                    SortExpression="NameOfBranches" />
                                <asp:BoundField DataField="Cities" HeaderText="Cities"
                                    SortExpression="Cities" />
                                <asp:BoundField DataField="Address" HeaderText="Address"
                                    SortExpression="Address" />
                                <asp:BoundField DataField="Telephone" HeaderText="Telephone"
                                    SortExpression="Telephone" />
                                <asp:BoundField DataField="Mobile" HeaderText="Mobile"
                                    SortExpression="Mobile" />
                                <asp:BoundField DataField="Fax" HeaderText="Fax" SortExpression="Fax" />
                                <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                                <asp:BoundField DataField="POBox" HeaderText="POBox" SortExpression="POBox" />
                            </Columns>
                            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                            ConflictDetection="CompareAllValues"
                            ConnectionString="<%$ ConnectionStrings:RidaItConnectionString %>"
                            DeleteCommand="DELETE FROM [CompanyBranches] WHERE [BranchesID] = @original_BranchesID AND [NameOfBranches] = @original_NameOfBranches AND [Cities] = @original_Cities AND [Address] = @original_Address AND [Telephone] = @original_Telephone AND [Mobile] = @original_Mobile AND [Fax] = @original_Fax AND [Email] = @original_Email AND [POBox] = @original_POBox"
                            InsertCommand="INSERT INTO [CompanyBranches] ([BranchesID], [NameOfBranches], [Cities], [Address], [Telephone], [Mobile], [Fax], [Email], [POBox]) VALUES (@BranchesID, @NameOfBranches, @Cities, @Address, @Telephone, @Mobile, @Fax, @Email, @POBox)"
                            OldValuesParameterFormatString="original_{0}"
                            SelectCommand="SELECT * FROM [CompanyBranches]"
                            UpdateCommand="UPDATE [CompanyBranches] SET [NameOfBranches] = @NameOfBranches, [Cities] = @Cities, [Address] = @Address, [Telephone] = @Telephone, [Mobile] = @Mobile, [Fax] = @Fax, [Email] = @Email, [POBox] = @POBox WHERE [BranchesID] = @original_BranchesID AND [NameOfBranches] = @original_NameOfBranches AND [Cities] = @original_Cities AND [Address] = @original_Address AND [Telephone] = @original_Telephone AND [Mobile] = @original_Mobile AND [Fax] = @original_Fax AND [Email] = @original_Email AND [POBox] = @original_POBox">
                            <DeleteParameters>
                                <asp:Parameter Name="original_BranchesID" Type="Object" />
                                <asp:Parameter Name="original_NameOfBranches" Type="String" />
                                <asp:Parameter Name="original_Cities" Type="String" />
                                <asp:Parameter Name="original_Address" Type="String" />
                                <asp:Parameter Name="original_Telephone" Type="Int32" />
                                <asp:Parameter Name="original_Mobile" Type="Int32" />
                                <asp:Parameter Name="original_Fax" Type="Int32" />
                                <asp:Parameter Name="original_Email" Type="String" />
                                <asp:Parameter Name="original_POBox" Type="Int32" />
                            </DeleteParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="NameOfBranches" Type="String" />
                                <asp:Parameter Name="Cities" Type="String" />
                                <asp:Parameter Name="Address" Type="String" />
                                <asp:Parameter Name="Telephone" Type="Int32" />
                                <asp:Parameter Name="Mobile" Type="Int32" />
                                <asp:Parameter Name="Fax" Type="Int32" />
                                <asp:Parameter Name="Email" Type="String" />
                                <asp:Parameter Name="POBox" Type="Int32" />
                                <asp:Parameter Name="original_BranchesID" Type="Object" />
                                <asp:Parameter Name="original_NameOfBranches" Type="String" />
                                <asp:Parameter Name="original_Cities" Type="String" />
                                <asp:Parameter Name="original_Address" Type="String" />
                                <asp:Parameter Name="original_Telephone" Type="Int32" />
                                <asp:Parameter Name="original_Mobile" Type="Int32" />
                                <asp:Parameter Name="original_Fax" Type="Int32" />
                                <asp:Parameter Name="original_Email" Type="String" />
                                <asp:Parameter Name="original_POBox" Type="Int32" />
                            </UpdateParameters>
                            <InsertParameters>
                                <asp:Parameter Name="BranchesID" Type="Object" />
                                <asp:Parameter Name="NameOfBranches" Type="String" />
                                <asp:Parameter Name="Cities" Type="String" />
                                <asp:Parameter Name="Address" Type="String" />
                                <asp:Parameter Name="Telephone" Type="Int32" />
                                <asp:Parameter Name="Mobile" Type="Int32" />
                                <asp:Parameter Name="Fax" Type="Int32" />
                                <asp:Parameter Name="Email" Type="String" />
                                <asp:Parameter Name="POBox" Type="Int32" />
                            </InsertParameters>
                        </asp:SqlDataSource>
                    </td>
                </tr>
            </table>
       
        </ContentTemplate>
        </asp:UpdatePanel>
    </asp:Content>

     

    Saturday, January 9, 2010 3:40 AM