Click here to Skip to main content
15,915,791 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHandling milliseconds in .Net Pin
indian1431-Mar-11 5:32
indian1431-Mar-11 5:32 
AnswerRe: Handling milliseconds in .Net Pin
Viral Upadhyay1-Mar-11 8:17
Viral Upadhyay1-Mar-11 8:17 
AnswerRe: Handling milliseconds in .Net Pin
meeram3952-Mar-11 0:22
meeram3952-Mar-11 0:22 
QuestionUploading photos to Flickr Pin
yetrus1-Mar-11 2:47
yetrus1-Mar-11 2:47 
AnswerRe: Uploading photos to Flickr Pin
yetrus11-Jan-12 10:12
yetrus11-Jan-12 10:12 
QuestionCrystol report error in google chrome Pin
pvchandana1-Mar-11 0:37
pvchandana1-Mar-11 0:37 
AnswerRe: Crystol report error in google chrome Pin
thatraja3-Mar-11 14:42
professionalthatraja3-Mar-11 14:42 
QuestionAjaxControlToolkit ModalPopupExtender in code behind [modified] Pin
Robert Espindola27-Feb-11 13:05
Robert Espindola27-Feb-11 13:05 
I am trying to get the value of a textbox once the user clicks the submit button.

I can get it using the following code but is there a better way? It makes no sense to me to actually view the source code to get
ctl00$ContentPlaceHolder1$DailyReceipts1$rpt_Ticket$ctl01$rpt_TicketDetail$ctl01$txt_qty
instead of coding to get it. Any help will be appreciated.

CODE in FRONT
<asp:ImageButton ID="imb_EditDetail" runat="server" AlternateText="Update Receipt" ImageUrl="edit.gif" OnClick="Update_TicketDetail" />
                                                        
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" 
TargetControlID="imgEditDetail"
PopupControlID="pnl_EditQty"
BackgroundCssClass="modalBackground"
DropShadow="true"
OnOkScript="ok()"
CancelControlID="Btn_CancelEdit" />

<asp:Panel ID="pnl_EditQty" runat="server" CssClass="modalBox" Style="display: none;" Width="300">
<asp:Panel HorizontalAlign="Center" ID="Panel2" runat="server" >Edit Quantity</asp:Panel>
            		
<asp:Label ID="lbl_Name" runat="server"></asp:Label><
<asp:TextBox ID="txt_qty" runat="server" ></asp:TextBox>

<asp:Button ID="Btn_Edit" runat="server" Text="Edit" Width="55px" OnClick="Btn_Edit_Item_Click"  CausesValidation="true" Itm_idx="" ticket_idx="" history_idx="" old_qty="" Control_id="" />
<asp:Button ID="Btn_CancelEdit" runat="server" Text="Cancel" Width="55px" buttonAction="submitButton" />
		                                                            	
</asp:Panel>

CODE BEHIND

    protected void Btn_Edit_Item_Click(object source, EventArgs e)
    {
        
        string id = ((Button)source).CommandArgument.ToString();
        string idx = ((Button)source).Attributes["Itm_idx"].ToString();
        string ticket_idx = ((Button)source).Attributes["ticket_id"].ToString();
        string history_idx = ((Button)source).Attributes["history_id"].ToString();
        string oldQty = ((Button)source).Attributes["old_qty"].ToString();
        string controlID = ((Button)source).Attributes["Control_id"].ToString();
        string detail = ((Button)source).Attributes["detail"].ToString();

        string itemQtyEdit = Request.Form["ctl00$ContentPlaceHolder1$Daily" + detail + "1$rpt_Ticket$ctl" + controlID + "$rpt_TicketDetail$ctl0" + idx + "$txt_qty"].ToString();
    //ctl00$ContentPlaceHolder1$DailyReceipts1$rpt_Ticket$ctl01$rpt_TicketDetail$ctl01$txt_qty
            
}


modified on Monday, February 28, 2011 8:14 AM

AnswerRe: AjaxControlToolkit ModalPopupExtender in code behind Pin
Not Active27-Feb-11 15:00
mentorNot Active27-Feb-11 15:00 
GeneralRe: AjaxControlToolkit ModalPopupExtender in code behind Pin
Robert Espindola27-Feb-11 16:46
Robert Espindola27-Feb-11 16:46 
GeneralRe: AjaxControlToolkit ModalPopupExtender in code behind Pin
Not Active27-Feb-11 17:11
mentorNot Active27-Feb-11 17:11 
AnswerRe: AjaxControlToolkit ModalPopupExtender in code behind Pin
Vimalsoft(Pty) Ltd28-Feb-11 22:37
professionalVimalsoft(Pty) Ltd28-Feb-11 22:37 
QuestionA proper DI implementation? Pin
Member 391904927-Feb-11 8:59
Member 391904927-Feb-11 8:59 
AnswerRe: A proper DI implementation? Pin
James Simpson28-Feb-11 3:57
James Simpson28-Feb-11 3:57 
GeneralRe: A proper DI implementation? Pin
Member 391904928-Feb-11 19:21
Member 391904928-Feb-11 19:21 
GeneralRe: A proper DI implementation? Pin
Member 391904928-Feb-11 20:01
Member 391904928-Feb-11 20:01 
GeneralRe: A proper DI implementation? Pin
James Simpson28-Feb-11 22:55
James Simpson28-Feb-11 22:55 
GeneralRe: A proper DI implementation? Pin
Member 39190491-Mar-11 8:44
Member 39190491-Mar-11 8:44 
GeneralRe: A proper DI implementation? Pin
Member 39190491-Mar-11 9:07
Member 39190491-Mar-11 9:07 
GeneralRe: A proper DI implementation? Pin
James Simpson1-Mar-11 10:02
James Simpson1-Mar-11 10:02 
AnswerRe: A proper DI implementation? Pin
Spectre_0013-Mar-11 2:03
Spectre_0013-Mar-11 2:03 
Questionpayment processor - your experience Pin
Jassim Rahma26-Feb-11 20:55
Jassim Rahma26-Feb-11 20:55 
AnswerRe: payment processor - your experience Pin
Abhijit Jana26-Feb-11 22:18
professionalAbhijit Jana26-Feb-11 22:18 
GeneralRe: payment processor - your experience Pin
Jassim Rahma3-Mar-11 1:12
Jassim Rahma3-Mar-11 1:12 
AnswerRe: payment processor - your experience Pin
N a v a n e e t h27-Feb-11 2:56
N a v a n e e t h27-Feb-11 2:56 

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.