Showing posts with label item. Show all posts
Showing posts with label item. Show all posts

Wednesday, March 28, 2012

Modal Popup and Listbox control

Is it possible to use modal popup with asp listbox control? I would like to show modal popup once an item in the asp lisbox is double-clicked. Any ideas, tips, help, or anything else on how to achieve this functionality?

Thanks in advance,
Marko Vuksanovic.

Answered here, I think:http://forums.asp.net/thread/1448453.aspx

Modal Popup Delete

Hey, I have a gridview with a linkbutton "delete". I made this originally with a rowcommand that deleted the item associated with that row. I am now implementing a modal pop-up to confirm deleteing the row of data. The pop-upworks fine, and appears when i click the linkbutton ( note the link button now has no "onclick" event ) the popup panel has two buttons inside it button1 and button2, 1 = confirm, 2 = cancel.

I set the CommandArguement of button1 to the ID of the item, and the CommandName to "DeleteMe". The command_row event is :

protected void GridView6_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "DeleteMe")
{
SqlCommand DeleteIt = new SqlCommand("DELETE FROM Items WHERE ItemD = '" + e.CommandArgument + "'", Connection);
Connection.Open();
DeleteIt.ExecuteNonQuery();
Connection.Close();
GridView6.DataBind();
}
}

When the user clicks button1 nothing happens.. im a little bit confused as to why, can anyone help? i assumed as the ajax extender is within the gridview row it would just continue to be a row command? if im way off can someone please let me know, thanks a million John

does anyone have an ideas? sorry to be a bit pushy but its driving me insane! lol, Ive done some random google searches and in the forums and i couldnt find anything, thanks John

Monday, March 26, 2012

Modal Popup In A Repeater

Hi,

Is there a way to use the ModalPopupExtender from inside a repeater -- each item would have a "delete" link button, and on clicking this, the Panel should be shown? Ive tried everything I can think of, but am not getting anywhere.

Thanks

Joe

Hmmm, I have seen modalpopupextender in the repeater before and it worked fine. Do you get any javascript errors, run-time errors about the extender setup, and how are you wiring the extender to the actual button that will cause the pop up to appear?


The ToolkitTests\Manual\DataboundDynamicPopulate.aspx file that comes with the Toolkit includes a ModalPopup in a repeater (DataList).


Thanks for the heads up. Between this and another article I found (sorry, cant find it right now to give credit), I came up with the solution I was looking for.

My solution is here (for my future reference): http://blog.joelowrance.com/archive/2007/07/10/ajax-modalpopupextender-in-a-repeater.aspx


Saturday, March 24, 2012

Modal Popup with asp.net controls on a masterpage through code behind

For some reason, if I have a masterpage, which has a modal popup control (or any toolkit item it seems) and if I have asp.net controls inside of that toolkit control like a textbox or something. If I try and access that textbox from code behind file of that masterpage it will not find it.

Anyone else had this issue?

I have commented out all my code and slowly tested my way through adding it back in and nothing works. But if I take that same exact code and put it on a regular (non-masterpage) file, it works like it's supposed to.

So what am I doing wrong on the masterpage to be able to find my controls from codebehind? Is there some sort of "extra" code I need to use to access items inside of a toolkit control for masterpages specifically?

Thanks.

Scratch that, I'm a freaking moron it seems.

I thought I was in the "page_load" sub, but I was not inside of any sub or function.

Apparently been a long day, I'm good now.

Thanks

Wednesday, March 21, 2012

modalpopup

hii need to use a modalpopup to add an item to my dropdownlist.my dropdownliste extract the itmes from an oracle database.

the client click on a botton to add the new item in the database and i want that the ddl refreshe.

can u help me plez.

1<asp:Panel runat="server" id="pnl_add">2 <asp:TextBox runat="server" id="txt_name" />3 <asp:RequiredFieldValidator runat="server" id="rfv_name"4 ControlToValidate="txt_name"5 ToolTip="Please enter a name"6 ErrorMessage=" *" />7 <asp:Button runat="server" id="btn_ok"8 Text="Ok" />9 <asp:Button runat="server" id="btn_cancel"10 Text="Cancel" />11</asp:Panel>12<ajaxToolkit:ModalPopupExtender runat="server" id="mpe_add"13 TargetControl="btn_add"14 PopupControlID="pnl_add"15 CancelControlID="btn_Cancel" />1617<asp:UpdatePanel runat="server" id="up_items"18 RenderMode="block"19 UpdateMode="conditional">20 <Triggers>21 <asp:AsyncPostBackTrigger22 ControlID="btn_Ok"23 EventName="Click" />24 </Triggers>25 <ContentTemplate>26 <asp:DropDownList runat="server" id="ddl_items" />27 </ContentTemplate>28</asp:UpdatePanel>
1Protected Sub btn_Ok_Click(sender asObject, e as EventArgs) handles btn_Ok.Click2'insert into database34 up_items.Update()5End Sub

ModalPopup - Dropdown List item change

I have a modal popup with a DDL on it. I want to capture what the new selected item and pass it to the server-side so I can process. How do I do this?

Thanks,

http://forums.asp.net/ShowPost.aspx?PostID=1379165

Thanks for the reply. Found the post you refer to, but it didn't fully answer my question. Exactly *how* does one code the client-side javascript to capture the DDL SelectedItem Change event?

The way the code is currently setup, it fires the server-side click event for the btnNoteSave button, and I can grab the content of the text boxes. You'll notice a hidden label field on the popup, i was hoping to use it to store the result of the selected item change from the dropdown.

The big question is, how do I do that?

Here is the code for the modal popup. THere is an ASCX control embedded in the note, Code for the ASCX is below.

 <asp:PanelID="pnlNewNote"runat="server"CssClass="modalPopup"Width="225px"><tablecellpadding="0"cellspacing="1"border="0"width="225px"class="tblSection">

<tr><tdcolspan="3"><uc1:NoteCtrlID="newNoteItem"runat="server"/></td></tr><trstyle="height:5px"><td></td></tr><tr><tdcolspan="3"style="text-align:center"><asp:ButtonID="btnNoteSave"runat="server"Text="Save"Width="50px"OnClick="btnNoteSave_Click"/><imgsrc="images/spacer.gif"style="width:15px"alt="space"/><asp:ButtonID="btnNoteCancel"runat="server"Text="Cancel"Width="50px"/></td></tr><trstyle="height:2px"><td></td></tr></table>

</

asp:Panel><cc1:ModalPopupExtenderID="newNotePopup"runat="server"TargetControlID="btnNewNote"DropShadow="true"PopupControlID="pnlNewNote"BackgroundCssClass="modalBackground"CancelControlID="btnNoteCancel"

/>

THE ASCX CONTROL:

<

tableborder="0"cellspacing="1"><tr><tdalign="right"><asp:LabelID="lblNoteDate"runat="server"Width="35px"CssClass="lblFormField">Date: </asp:Label></td><tdalign="left"><asp:TextBoxID="txtNoteDate"runat="server"Width="150px"CssClass="txtFormField"/></td></tr><tr><tdalign="right"><asp:LabelID="lblCallType"runat="server"CssClass="lblFormField">Call Type: </asp:Label></td><tdalign="left"><asp:DropDownListID="ddlCallTypes"runat="server"Width="155px"OnSelectedIndexChanged="ddlCallTypes_SelectedIndexChanged"/></td></tr><tr><tdalign="right"><asp:LabelID="lblUser"runat="server"CssClass="lblFormField">User: </asp:Label></td><td><asp:LabelID="lblUserData"runat="server"CssClass="txtFormField"/></td></tr><tr><tdcolspan="2"><asp:TextBoxID="txtNotes"runat="server"TextMode="MultiLine"Width="200px"Rows="5"CssClass="txtFormField"/></td></tr>

</

table>

<

divstyle="visibility:hidden"><asp:LabelID="lblCallTypeValue"runat="server"Text="Label"></asp:Label>

</

div>


The DropDownList.SelectedItemChanged event is a server-side event, not a client-side event.