Click here to Skip to main content
15,911,035 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Button click's event handler Pin
Venkatesh Mookkan1-Jan-07 17:53
Venkatesh Mookkan1-Jan-07 17:53 
Questionhow to make Menu Item text wrap automatically? Pin
vicky45728-Dec-06 12:05
vicky45728-Dec-06 12:05 
AnswerIs there anyone using Menu in .Net 2.0? Pin
vicky45729-Dec-06 7:03
vicky45729-Dec-06 7:03 
AnswerRe: how to make Menu Item text wrap automatically? Pin
Sandip Kansara2-Jan-07 18:26
Sandip Kansara2-Jan-07 18:26 
GeneralRe: how to make Menu Item text wrap automatically? Pin
vicky4573-Jan-07 9:51
vicky4573-Jan-07 9:51 
QuestionFile Uploads and Wizards Pin
gantww28-Dec-06 10:58
gantww28-Dec-06 10:58 
AnswerRe: File Uploads and Wizards Pin
Sandip Kansara2-Jan-07 19:22
Sandip Kansara2-Jan-07 19:22 
QuestionGetting the value from ascx property to the parent aspx page [modified] Pin
djscratch28-Dec-06 9:38
djscratch28-Dec-06 9:38 
im very new to NET and i apologize if this is a fundamental question, but i need some help.
i have an ascx file (inherits a cs file) loaded into an aspx file. in this code example, i click on the ascx file's radiobuttonlist. the radiobuttonlist's onselectedindexchanged methods fires a method in the ascx cs file. the cs method takes the value from the ascx radiobuttonlist and sets a cs property to the radiobuttonlist's selectedvalue. also, it takes sets a literal in the ascx file to the property value. in the aspx file, during the page_load, i call the ascx file's property and set the value to a literal inside the aspx file (but not in the ascx file). the code kind of works, but it's one click late. when i change the ascx radio buttons, the ascx literal updates. however, intially, the aspx literal does not change. the aspx literal does not change until the second radio button click.

i would greatly appreicate any help with this one. thanks from a newbie


void Page_Load(object s, EventArgs e)
{
string strControl;
Control ctl;
strControl = "radio";
ctl = LoadControl(strControl + ".ascx");
//((radio)ctl).choiceValue = "";
pl_radio.Controls.Add(ctl);
litResult.Text = ((radio)ctl).choiceValue;
}


<title>Radio Default File




<asp:placeholder id="pl_radio" runat="server">

From ASCX choicevalue property set during oo button click or radio
select change :
<asp:literal id="litResult" runat="server">


++++++++++++++++++++++++++++++++++++++++
ASCX file -
<%@ Control Language="C#" AutoEventWireup="true" Inherits="radio" %>

void Page_Init(object s, EventArgs e)
{
//choiceValue = "red";
}


<asp:radiobuttonlist id="rad_Choice"
="" onselectedindexchanged="button_click" autopostback="true" runat="server">
<asp:listitem text="Choice 1" value="1" selected="true">
<asp:listitem text="Choice 2" value="2">



<asp:literal id="litChoice" runat="server">


<asp:button id="btn_radio" onclick="button_click" text="Submit"
runat="server">
+++++++++++++++++++++++++++++++++++++++
CS compiled - radio

public class radio:UserControl
{
public radio()
{
//
// TODO: Add constructor logic here
//
}

protected RadioButtonList rad_Choice;
protected Literal litChoice;
private string _choiceValue;

public string choiceValue
{
get
{
return rad_Choice.SelectedValue;
}
set
{
_choiceValue = value;
}
}

public void button_click(object s, EventArgs e)
{
choiceValue = rad_Choice.SelectedValue;
litChoice.Text = choiceValue;
}

}





-- modified at 16:05 Thursday 28th December, 2006
AnswerRe: Getting the value from ascx property to the parent aspx page Pin
djscratch28-Dec-06 10:22
djscratch28-Dec-06 10:22 
QuestionHow to parse xls and csv Pin
alexfromto28-Dec-06 9:23
alexfromto28-Dec-06 9:23 
AnswerRe: How to parse xls and csv Pin
Venkatesh Mookkan28-Dec-06 18:55
Venkatesh Mookkan28-Dec-06 18:55 
GeneralRe: How to parse xls and csv Pin
alexfromto29-Dec-06 3:09
alexfromto29-Dec-06 3:09 
GeneralRe: How to parse xls and csv Pin
Venkatesh Mookkan1-Jan-07 17:56
Venkatesh Mookkan1-Jan-07 17:56 
GeneralRe: How to parse xls and csv Pin
alexfromto2-Jan-07 3:56
alexfromto2-Jan-07 3:56 
GeneralRe: How to parse xls and csv Pin
Venkatesh Mookkan2-Jan-07 15:47
Venkatesh Mookkan2-Jan-07 15:47 
QuestionPlease help me(java script) Pin
kishore19@hotmail.com28-Dec-06 6:47
kishore19@hotmail.com28-Dec-06 6:47 
AnswerRe: Please help me(java script) Pin
ednrgc28-Dec-06 8:38
ednrgc28-Dec-06 8:38 
AnswerRe: Please help me(java script) Pin
Venkatesh Mookkan28-Dec-06 16:13
Venkatesh Mookkan28-Dec-06 16:13 
QuestionRegister a DLL (SolPartWebMenu) Pin
RX Maverick28-Dec-06 5:50
RX Maverick28-Dec-06 5:50 
QuestionRequiredFieldValidator Pin
krutika_mail28-Dec-06 4:03
krutika_mail28-Dec-06 4:03 
AnswerRe: RequiredFieldValidator Pin
Not Active28-Dec-06 5:13
mentorNot Active28-Dec-06 5:13 
AnswerRe: RequiredFieldValidator Pin
ednrgc28-Dec-06 8:42
ednrgc28-Dec-06 8:42 
Questionasp:Table vs. an HTML table Pin
RX Maverick28-Dec-06 3:29
RX Maverick28-Dec-06 3:29 
AnswerRe: asp:Table vs. an HTML table Pin
Not Active28-Dec-06 4:05
mentorNot Active28-Dec-06 4:05 
GeneralRe: asp:Table vs. an HTML table Pin
RX Maverick28-Dec-06 5:27
RX Maverick28-Dec-06 5:27 

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.