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...
  • How do I increase organic traffic within One Month
    There’s plenty you can do boost organic site traffic at no cost except your time: Optimize for your personas, not search engines.  ...
  • Top Most Differences between windows,web and console applications
    You want to get clarity on any topic the differences very helpful at that time and in these we are having top 5 differences between conso...
  • 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 ...
  • How to Remove Audio From Any Video Using VLC Media Player?
    Step by Step Procedure for  Remove(Mute) Audio in a Video Using VLC  Player A picture is worth a thousand words and a video is worth a t...
  • Best Methods To Get A Cheap Home Insurance Deal!
    Cheap Home Insurance Home Insurance is seen as a luxury but in all honesty it is a necessity especially in the case of natural disast...
  • Connected and Disconnected Data Access Architecture
    The Ado.Net Frame Work Supports Two Models of Data Access Architectures one is Connected Oriented architecture and second One is Disconnec...
  • 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...
  • 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...
  • INTERESTING PSYCHOLOGICAL FACTS ABOUT GIRLS Love In Valentines Day
    Girls Love And Caring Love feelings are very interesting to every one and moreover girls feelings are very interesting and amazing a...

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•