Anchor Tag In Code Behind
-
Hi All, I am developing one website. In That I want to call a popup window on dropdown_selectedIndexChaged. If I put That DropDown in an Anchor tag The Window Opens As Soon As I Click On DropDown Which I Dont Want. I Want that Popup Should Open After Selecting The Value Of That DropDown. So Please Help Me To Solve My Problem. And is there any way to write Anchor Tag in code behind and Call It On dropdown_selectedIndexChaged To Open A Popup. My Anchor tag Is Like This :
<a id="AA1" runat="server" class="thickbox" title="" href="InventoryQty.aspx?action=add&TB\_iframe=true&height=420&width=700"> <asp:DropDownList ID="InsertDDLItem1" runat="server" AppendDataBoundItems="true" DataTextField="ItemName" DataValueField="ItemID" AutoPostBack="true" OnSelectedIndexChanged="InsertDDLItem1\_SelectedIndexChanged" Width="280px"> <asp:ListItem Selected="True" Value="0">Select ITem Type</asp:ListItem> </asp:DropDownList> </a>
Please Help Me To Solve My Problem. Thanks & Regards Sanket Patil :) :)
.
-
Hi All, I am developing one website. In That I want to call a popup window on dropdown_selectedIndexChaged. If I put That DropDown in an Anchor tag The Window Opens As Soon As I Click On DropDown Which I Dont Want. I Want that Popup Should Open After Selecting The Value Of That DropDown. So Please Help Me To Solve My Problem. And is there any way to write Anchor Tag in code behind and Call It On dropdown_selectedIndexChaged To Open A Popup. My Anchor tag Is Like This :
<a id="AA1" runat="server" class="thickbox" title="" href="InventoryQty.aspx?action=add&TB\_iframe=true&height=420&width=700"> <asp:DropDownList ID="InsertDDLItem1" runat="server" AppendDataBoundItems="true" DataTextField="ItemName" DataValueField="ItemID" AutoPostBack="true" OnSelectedIndexChanged="InsertDDLItem1\_SelectedIndexChanged" Width="280px"> <asp:ListItem Selected="True" Value="0">Select ITem Type</asp:ListItem> </asp:DropDownList> </a>
Please Help Me To Solve My Problem. Thanks & Regards Sanket Patil :) :)
.
This would best be implemented using JavaScript and handling the onchange event there to open the new window.
I know the language. I've read a book. - _Madmatt
-
Hi All, I am developing one website. In That I want to call a popup window on dropdown_selectedIndexChaged. If I put That DropDown in an Anchor tag The Window Opens As Soon As I Click On DropDown Which I Dont Want. I Want that Popup Should Open After Selecting The Value Of That DropDown. So Please Help Me To Solve My Problem. And is there any way to write Anchor Tag in code behind and Call It On dropdown_selectedIndexChaged To Open A Popup. My Anchor tag Is Like This :
<a id="AA1" runat="server" class="thickbox" title="" href="InventoryQty.aspx?action=add&TB\_iframe=true&height=420&width=700"> <asp:DropDownList ID="InsertDDLItem1" runat="server" AppendDataBoundItems="true" DataTextField="ItemName" DataValueField="ItemID" AutoPostBack="true" OnSelectedIndexChanged="InsertDDLItem1\_SelectedIndexChanged" Width="280px"> <asp:ListItem Selected="True" Value="0">Select ITem Type</asp:ListItem> </asp:DropDownList> </a>
Please Help Me To Solve My Problem. Thanks & Regards Sanket Patil :) :)
.
First of all, get rid of the anchor tag. You'll need to use the onchange event to initiate some JavaScript to open a window. You'll have to modify it a bit to work with your code, but this is some code I had laying around that you can use:
<script type="text/javascript">
function HandleDDClick(element) {
if(element.selectedIndex > 0) {
var url = element.options[element.selectedIndex].value;
window.open(url);
}
}
</script> -
Hi All, I am developing one website. In That I want to call a popup window on dropdown_selectedIndexChaged. If I put That DropDown in an Anchor tag The Window Opens As Soon As I Click On DropDown Which I Dont Want. I Want that Popup Should Open After Selecting The Value Of That DropDown. So Please Help Me To Solve My Problem. And is there any way to write Anchor Tag in code behind and Call It On dropdown_selectedIndexChaged To Open A Popup. My Anchor tag Is Like This :
<a id="AA1" runat="server" class="thickbox" title="" href="InventoryQty.aspx?action=add&TB\_iframe=true&height=420&width=700"> <asp:DropDownList ID="InsertDDLItem1" runat="server" AppendDataBoundItems="true" DataTextField="ItemName" DataValueField="ItemID" AutoPostBack="true" OnSelectedIndexChanged="InsertDDLItem1\_SelectedIndexChanged" Width="280px"> <asp:ListItem Selected="True" Value="0">Select ITem Type</asp:ListItem> </asp:DropDownList> </a>
Please Help Me To Solve My Problem. Thanks & Regards Sanket Patil :) :)
.
Oh man,if you have the dropdownlist's autopostback on ,then you will get the popup very hard. you can register your popup code in the indexchabged event.or just like above,you can write the popup code in the client,and register the popupcode into the dropdownlist ,and use the onchange event to trigger.
I can do!