Folks, environment: UI for ASP.Net Ajax Q1 2016 With VS 2013. and using below Telerik link as a prototype in my project.
I have a sql table in SQL Server that has 2 columns, 1) Link 2) URL (i.e. https://www.google.com/ or https://www.yahoo.com/) In my edit form,
hyperlink button is pulling data (i.e. URL in Item Databound event. Works fine.
<table> <tr> <td style="font-size: 11px">Community District: </td> <td> <asp:TextBox ID="CDTextBox" Font-Size="11px" Text='<%# Bind( "CD") %>' runat="server" TabIndex="8"> </asp:TextBox> <asp:HyperLink ID="HyperLinkCD" Style="text-decoration: underline; border-color: InfoBackground; margin: inherit; font-size: 12px; color: #228B22; font-family: Calibri; font-weight: 700" Text="Link" Target="_blank" runat="server" TabIndex="9"></asp:HyperLink> </td> </tr></table> protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridEditableItem && e.Item.IsInEditMode && e.Item.OwnerTableView.Name == "Master") { GridEditableItem editem = (GridEditableItem)e.Item; TextBox txtcd = (TextBox)editem.FindControl("CDTextBox"); string Stcd = txtcd.Text.ToString().TrimEnd(); SqlCommand cmdcontrol = new SqlCommand("SELECT Link from Cd_Link" + "WHERE [CD] = '" + Stcd + "'", SqlConnection); SqlConnection.Open(); SqlDataReader objDR = cmdcontrol.ExecuteReader(); if (objDR.Read()) { string stnycUrlLink = objDR["Link"].ToString().TrimEnd(); Pulling URL from SQL Column ex: https://www.google.com/ or https://www.yahoo.com/ stnycUrlLink = "" + stnycUrlLink + ""; HyperLink hyperLinkCD = (HyperLink)editem.FindControl("HyperLinkCD"); hyperLinkCD.NavigateUrl = stnycUrlLink; hyperLinkCD.Attributes["href"] = "#"; hyperLinkCD.Attributes["onclick"] = String.Format("return Show_CDMap('{0}');", stnycUrlLink); Session["MapSource"] = "Program"; Session["Sturl"] = stnycUrlLink; } } } function Show_CDMap(seltxt) { var seltxtbx = seltxt.value; alert(seltxt); ex: https://www.google.com/ or https://www.yahoo.com/ var oWind = window.radopen("ShowCDMaps.aspx", "UserListDialog"); oWind.setSize(document.body.scrollWidth - 170, document.body.scrollHeight + 180); oWind.set_modal(true); oWind.Center(); oWind.Maximize(); return false; } I would like to pass that URL to edit form and open that URL. Another word if hyperlink button is grabing https://www.yahoo.com/ from SQL Table, then open https://www.yahoo.com/
inside edit dialog form.
My codes are below. Any help will be appreciated.
gc_0620