Click here to Skip to main content
15,923,273 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionhow can design a template for GridView? Pin
B.A21-Jan-08 7:32
B.A21-Jan-08 7:32 
AnswerRe: how can design a template for GridView? Pin
_AK_21-Jan-08 21:53
_AK_21-Jan-08 21:53 
GeneralRe: how can design a template for GridView? Pin
B.A21-Jan-08 23:21
B.A21-Jan-08 23:21 
GeneralNeed help for connection to webservice! Pin
Member 470816321-Jan-08 4:16
Member 470816321-Jan-08 4:16 
GeneralRe: Need help for connection to webservice! Pin
pmarfleet21-Jan-08 9:35
pmarfleet21-Jan-08 9:35 
GeneralAny asp.net control Pin
Member 406547221-Jan-08 3:22
Member 406547221-Jan-08 3:22 
GeneralRe: Any asp.net control Pin
Michael Sync21-Jan-08 4:21
Michael Sync21-Jan-08 4:21 
GeneralRe: Any asp.net control Pin
Kariem Soudy21-Jan-08 4:24
Kariem Soudy21-Jan-08 4:24 
hello,
please follow these steps:
1)create a web user control named Education and contains your 3 controls and customize it as u like,it should be like this:
]]>
<asp:panel id="Panel1" runat="server" width="200px" borderstyle="Solid" bordercolor="Black" borderwidth="1">


School
<asp:textbox id="TextBox1" runat="server">


 Major
<asp:textbox id="TextBox2" runat="server">


Degree
<asp:dropdownlist id="DropDownList1" runat="server">





2)in your webform add this directive in the top of the page code right after the <%@ page %> directive:
]]>

3)add this code in your webform code:
<asp:panel id="Panel1" runat="server"><br />
        <%<br />
            try<br />
            {<br />
                int ItemsCount = 0;<br />
                ItemsCount = Convert.ToInt32(Session["ItemsCount"].ToString());<br />
                for (int i = 0; i < ItemsCount; i++)<br />
                {<br />
                    int Counter = i + 1;<br />
                    Education1.ID = "Education" + Counter.ToString();<br />
                %><br />
                    <uc1:education runat="server" id="Education1" /><br />
                <%<br />
                }<br />
            }<br />
            catch (Exception ex)<br />
            {<br />
             }<br />
         %><br />
</asp:panel>


4)add a button and type this in the click event;
if (Session["ItemsCount"] != null)<br />
 {<br />
     int SessionValue = Convert.ToInt32(Session["ItemsCount"].ToString());<br />
     SessionValue++;<br />
     Session["ItemsCount"] = SessionValue.ToString();<br />
 }<br />
 else<br />
 {<br />
     Session["ItemsCount"] = "1";<br />
 }


that's it, and you may put all of that in an updatepanel to have the AJAX effect....

i wish that could help you, please let me know if there're any errors...

Web Developer @ Silverkey Egypt

GeneralRe: Any asp.net control Pin
Kariem Soudy21-Jan-08 4:28
Kariem Soudy21-Jan-08 4:28 
GeneralRe: Any asp.net control Pin
Member 406547223-Jan-08 5:28
Member 406547223-Jan-08 5:28 
Generalproblem with ProfileBindings Pin
Kariem Soudy21-Jan-08 2:50
Kariem Soudy21-Jan-08 2:50 
Generalsentax for C# statement whilw using SQL query Pin
mavii21-Jan-08 2:31
mavii21-Jan-08 2:31 
GeneralMultipost and Wrong Forum -- Please ignore Pin
Vasudevan Deepak Kumar21-Jan-08 3:13
Vasudevan Deepak Kumar21-Jan-08 3:13 
GeneralRe: sentax for C# statement whilw using SQL query Pin
Kariem Soudy21-Jan-08 3:26
Kariem Soudy21-Jan-08 3:26 
GeneralRe: sentax for C# statement whilw using SQL query Pin
mavii21-Jan-08 5:50
mavii21-Jan-08 5:50 
GeneralHelp me Pin
Zeeshan Ahmed Memon21-Jan-08 1:56
Zeeshan Ahmed Memon21-Jan-08 1:56 
GeneralRe: Help me Pin
pmarfleet21-Jan-08 2:08
pmarfleet21-Jan-08 2:08 
GeneralCrystal Report Printing Issue Pin
Kamal.Afridi21-Jan-08 1:29
Kamal.Afridi21-Jan-08 1:29 
GeneralError : asp.net client side framework failed to load Pin
ntrraorao21-Jan-08 1:23
ntrraorao21-Jan-08 1:23 
GeneralRe: Error : asp.net client side framework failed to load Pin
Michael Sync21-Jan-08 4:27
Michael Sync21-Jan-08 4:27 
GeneralPage back button problem Pin
macca2421-Jan-08 0:39
macca2421-Jan-08 0:39 
GeneralRe: Page back button problem Pin
Venkatesh Mookkan21-Jan-08 0:44
Venkatesh Mookkan21-Jan-08 0:44 
GeneralRe: Page back button problem Pin
macca2421-Jan-08 2:20
macca2421-Jan-08 2:20 
GeneralRe: Page back button problem Pin
Venkatesh Mookkan21-Jan-08 18:07
Venkatesh Mookkan21-Jan-08 18:07 
GeneralRe: Page back button problem Pin
macca2421-Jan-08 22:55
macca2421-Jan-08 22:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.