Wednesday, October 15, 2014

Started With Simple WebApplication in Visual Studio 2010

1. Open Visual Studio 2010

2. Click on File Menu
                                  -> New
                                              -> Website and then click ok
3. A new Window is opened and add your Folder path over there when you want to save site or click on Browse button and Select the Path of The Project and then Click ok


4. Click on the Default.aspx file
                      this file is default came in the site

                                                           
remove the Extra Content
like:
   <h2>
        Welcome to ASP.NET!
    </h2>
    <p>
        To learn more about ASP.NET visit <a href="http://www.asp.net" title="ASP.NET Website">www.asp.net</a>.
    </p>
    <p>
        You can also find <a href="http://go.microsoft.com/fwlink/?LinkID=152368&amp;clcid=0x409"
            title="MSDN ASP.NET Docs">documentation on ASP.NET at MSDN</a>.
    </p>

5. Right click on the Default.aspx  Page and then view in browser
this step open a browser and you can appear the site in browser

6. In Browser it looks like
7. Now Lets Create the Sample Application(Addition of the two number)

Click on the toolbox and Simply Drag and Drop the 2 Textbox and one button on click of button we have to print addition of the number





now we have to fire the click event of the button

click one design
and simply Double Click on the button
After Clicking New Window is open it is .cs file (Code File)
now inside the button click event we have to make coding of addition
 protected void Button1_Click(object sender, EventArgs e)
    {

    }


add the code
 int a = Convert.ToInt32(TextBox1.Text);
        int b = Convert.ToInt32(TextBox2.Text);
        Response.Write(a + b);

note:
we can only make addition of the real number not string so textbox is always return the String Value so we have to convert it in integer or float
thats Why We use Convert.ToInt32()

now the screen looks like
click on the view in browser and see the output
on the top most Corner You Find The Answer Of the input number
 ok thats All For the day.......................







No comments:

Post a Comment