Technology Guruu

  • Home
  • Site Info
    • About Us
    • Disclaimer
    • Privacy Polacy
  • Home
  • Digital Marketing
    • SEO
    • SMM
    • SEM
  • Quotes
  • Technical
  • Java
  • .Net
    • C#.Net
    • ASP.Net
  • Keychains

Saturday, 9 July 2016

Asp.NET Logical Programs

 Akansha     11:30:00     TechnicalQuestions     No comments   

In the following program there are three radio buttons and one submit button whenever we click on one radio button and click on submit it will display a simple msg i.e., your favourite image is teddy like that for this design first we open visual studio and select asp.net application in that we select a webform1 on that select WebForm1.aspx design and drag and drop the all required controls i.e.,three radio buttons,one label,one button.Write a logical code in WebForm1.aspx.cs file.

TOP MOST Asp.Net programs

asp

1.Output:
           
                Select your favourite image

                   

                   
                   
                   
                      
                     
                     

                       your favourite image is:Teddy

Solution:WebForm1.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace task_5
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (RadioMoon.Checked)
{
lblMsg.Text = "your favourite image is:" + RadioMoon.Text;
}
else if (RadioRoses.Checked)
{
lblMsg.Text = "your favourite image is:" + RadioRoses.Text;
}
else if (RadioTeddy.Checked)
{
lblMsg.Text = "your favourite image is:" + RadioTeddy.Text;
}}}}

WebForm1.aspx(design)                

                Select your favourite image

                   

                   
                   
                   
                      
                     
                     
                    [lblMsg]
                                
2.WebForm1.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace task_6
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (RadioButtonList1.SelectedIndex == 0)
{
Image1.ImageUrl = "Moon.jpg";
}
else if (RadioButtonList1.SelectedIndex == 1)
{
Image1.ImageUrl = "Roses.jpeg";
}
else if (RadioButtonList1.SelectedIndex == 2)
{
Image1.ImageUrl = "Teddy.jpg";
}
}
}}
WebForm1.aspx(design)
Select your favourite image
Moon.jpg
Roses.jpeg
Teddy.jpg

Image

Output:Select your favourite image
  • Moon.jpg 
  • Roses.jpeg 
  • Teddy.jpg
    rose
3.output
             
Your city is Guntur
Solution:
WebForm1.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace selest_state
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ListState_SelectedIndexChanged(object sender, EventArgs e)
{
if (ListState.SelectedIndex == 0)
{
Label1.Text = "pls select your state";
}
else if(ListState.SelectedIndex==1)
{
Label1.Text = "";
ListCity.Items.Clear();
ListCity.Items.Add("-select-");
ListCity.Items.Add("Guntur");
ListCity.Items.Add("Vijayawada");
ListCity.Items.Add("vizag");
}
else if(ListState.SelectedIndex==2)
{
Label1.Text = "";
ListCity.Items.Clear();
ListCity.Items.Add("-select-");
ListCity.Items.Add("Hyderabad");
ListCity.Items.Add("Nalgonda");
ListCity.Items.Add("Warangal");
}
else if(ListState.SelectedIndex==3)
{
Label1.Text = "";
ListCity.Items.Clear();
ListCity.Items.Add("-select-");
ListCity.Items.Add("Baangalore");
ListCity.Items.Add("Mysore");
ListCity.Items.Add("Mangalore");
}
else
{
}
}
protected void ListCity_SelectedIndexChanged(object sender, EventArgs e)
{
if (ListCity.SelectedIndex == 0)
{
lblmsg.Text = "pls select your city";
}
else
{
lblmsg.Text = "your city is:" + ListCity.SelectedItem;
}
}
}
}
WebForm1.aspx[design]

                                     [lblMsg]                                                        
                                     


                                     

                                               [lbl]            

Friends today my article about asp.net it is very useful for all students/employees so please share this to all your friends through Facebook,Twitter,Google+.                            
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Popular Posts

  • Brief description about Delegates
    Introduction about delegates and why delegates are came the main purpose of delegates how to useful and what are the advantages and disadv...
  • Missing My Friend Quotes : Friendship Day Quotes 2017
    Friends today my article about missing friends and moments with them. Here you are seen the best friendship quotes and some  feelings when...
  • Na Tanu Samjhawan Ki Song lyrics
    Na Tanu Samjhawan Ki Song Lyrics With English Translation Movie : Humpty Sharma ki Dulhaniya Song : Samjhawan Song Singer : Arijit ...
  • Detail Introduction about C#.Net
    Brief Introduction about C#.Net  Introduction C#.Net is the one of the Programming Language the .Net Framework also contains ano...
  • Love Failure Quotes and Sad valentines day Quotes
    We Love Someone is a easy process sometime takes long time to love someone love others within short period but anyway always love dependin...
  • Top 10 valentine's day Quotes and Greetings wishes
    All Lovers have Anxiety in Valentines day because it is a festival to all lovers in these they enjoy a lot and celebrate the Valentine...
  • Wonderful sayings about Life.
    I Believe Follow  Things(Life Quotes) I Believe I believe: ********** Believe in Life ********** That we don't have to chan...
  • Brief Description about Multicast Delegate
    Multicast delegate is an extension of normal delegate. It helps you to point more than one method at a single moment of time. Multicast ...
  • Letter B wallpapers and keychains for facebook
    In these we are Providing Letter B Wallpapers and awesome Key chains also Some Facebook Profile Pictures and cover photos also we are prov...
  • Best Good Afternoon wishes greetings and quotes
    Top Most Good Afternoon Wishes Good Afternoon wishes are gives a relaxation in afternoon time.This wishing can be done between 12 to 3 p...

Categories

  • Entertainment (67)
  • TechnicalQuestions (58)
  • Quotes (11)
  • C#.Net (8)
  • Java (8)
  • ValentinesDay (4)
  • SEO (3)
  • Home
  • About Us
  • Disclaimer
  • Privacy Policy
  • Sitemap

Copyright © 2015-2017 Good Friends 5.All Rights Reserved• And Our Sitemap • All Logos and Trademark Belongs To Their Respective Owners•