Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all 5678 articles
Browse latest View live

Selecting a Dropdown List item Closes the Popup Window

$
0
0

In the code below; the "AutoPostBack" is set to true. When I select an item from the dropdown list; the popup window gets close automatically but returns the selected value. If I set "AutoPostBack" to false then it won't close popup but it will not return selected value.

What do I need to do so the popup won't close until I click on "Cancel"  or "Search" button?

<cc1:modalpopupextender id="ModalPopupExtender1" runat="server"
                OnOkScript="onModalOk();"
	            cancelcontrolid="btnCancel"
                okcontrolid="BtnSubmit"
	            targetcontrolid="lnkBtn_AddFromdatabase"
                popupcontrolid="panel1"
	            popupdraghandlecontrolid="PopupHeader" drag="true"
	            backgroundcssclass="ModalPopupBG"></cc1:modalpopupextender><asp:panel id="Panel1" style="display: none" runat="server"><div class="HellowWorldPopup"><div class="PopupHeader" id="PopupHeader">Database Search</div><div></div><br /><br /><div class="popup_Body" style="border:black 2px"><p>&emsp;&emsp;&emsp;Name:<asp:textbox id="txtName" runat="server"></asp:textbox></p><p>&emsp;&emsp;&emsp;<asp:Label ID="lblCompany" runat="server" Text="Company:"></asp:Label><asp:DropDownList ID="ddl_Company" runat="server" AutoPostBack="true" OnSelectedIndexChanged="OnSelectedIndexChanged_ddlCompany"></asp:DropDownList></p><p>&emsp;&emsp;&emsp;<asp:Label ID="lblID" runat="server" Text="ID:"></asp:Label><asp:DropDownList ID="ddl_Empployee" runat="server" AutoPostBack="true" OnSelectedIndexChanged="OnSelectedIndexChanged_ddlEmployee"></asp:DropDownList></p></div><br /><br /><div class="Controls" style="text-align:center"><input id="BtnSubmit" type="button" value="Search"/><input id="btnCancel" type="button" value="Cancel" /></div></div></asp:panel>
<style type="text/css">
    .ModalPopupBG
{
    background-color: #666699;
    filter: alpha(opacity=50);
    opacity: 0.7;
}

.AppPopup
{
    min-width:400px;
    min-height:275px;
    background-color:lightsteelblue;
    border-width: 3px;
    border-style: solid;
    border-color: white;
}
.popupBody
{
    min-width:400px;
    min-height:275px;
    background-color:lightsteelblue;
    border-width: 3px;
    border-style: solid;
    border-color: white;
}
.PopupHeader
{
    background:green;
    background-color:navy;
    color:yellow;
}
</style>
        protected void OnSelectedIndexChanged_ddlCompany(object sender, EventArgs e)
        {
            string sSelectedValue = "Selected Item: " + ddl_Company.SelectedItem.Text;
            ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", "alert('" + sSelectedValue + "');", true);
        }




Ajax ActionLink causes new page to be created instead of staying on the page as Partial result

$
0
0

Here is the simple data 

 @Ajax.ActionLink("update", "page1data", "Home", new AjaxOptions { HttpMethod = "Get", OnSuccess = "function (result) { $('#mydiv').html(result)" });

And then 

<div id="mydiv">Here is where the text goes</div>

When the ajax runs, it creates a new web page thats not part of my project at localhost:/whatever/Home/page1data 

The goal, the actual need is to fetch data to fill a Grid and it needs to be formatted in JSON.   So in the Home controller there is the method that correctly returns the JSON from the database, works great.  Just not able to get this into the Grid, because am not able to get the JSON result into a jquery or javascript friendly variable.

Can the HTML helper for ajax be used here?  or does the ajax have to be constructed manually?    I have done this before a while back and dont recall the syntax to get the results from the Ajax into the local variable, unable to find any examples;  the http GET method lives at /Home/page1data  and takes no arguments, it returns JSON

Thanks for any help

Pass values from modalpopupextender to Parent Window

$
0
0

I am trying to set value of two textboxes from a modal popup screen but it won't return any thing; what am I doing wrong?

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Employee.aspx.cs" Inherits="WebApplication2.Employee" %><%@ Register Assembly="ASP.Web.UI.PopupControl" Namespace="ASP.Web.UI.PopupControl" TagPrefix="ASPP" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"><title>AutoComplete Box with jQuery</title><link href="css/ui-lightness/jquery-ui-1.8.21.custom.css" rel="stylesheet" type="text/css" /><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script><style type="text/css">
 .ModalPopupBG
{
    background-color: #666699;
    filter: alpha(opacity=50);
    opacity: 0.7;
}

.HellowWorldPopup
{
    min-width:200px;
    min-height:150px;
    background-color:burlywood;
    border-width: 3px;
    border-style: solid;
    border-color: brown;
}
.PopupHeader
{
    background:green;
    background-color:navy;
    color:yellow;
}
</style><script>
    function onModalOk()
    {
        document.getElementById("TextBox2").innerText = document.getElementById('Company').value;
        document.getElementById("TextBox3").innerText = document.getElementById('ddlEmp').value;
    }</script></head><body><form id="form1" runat="server"><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><asp:TextBox ID="TextBox3" runat="server"></asp:TextBox><asp:button id="Button1" runat="server" text="Button" /><cc1:modalpopupextender id="ModalPopupExtender1" runat="server"
            OnOkScript="onModalOk();"
	        cancelcontrolid="btnCancel" okcontrolid="btnOkay"
	        targetcontrolid="Button1" popupcontrolid="Panel1"
	        popupdraghandlecontrolid="PopupHeader" drag="true"
	        backgroundcssclass="ModalPopupBG"></cc1:modalpopupextender><asp:panel id="Panel1" style="display: none" runat="server"><div class="HellowWorldPopup"><div class="PopupHeader" id="PopupHeader">People Search</div><div class="popup_Body"><p>Enter you name:<asp:textbox id="TextBox1" runat="server"></asp:textbox></p><p><asp:Label ID="lblCompany" runat="server" Text="Company:"></asp:Label><asp:DropDownList ID="ddlEmp" runat="server"></asp:DropDownList></p></div><div class="Controls"><input id="btnOkay" type="button" value="Done" /><input id="btnCancel" type="button" value="Cancel" /></div></div></asp:panel></form></body></html>

Issue with modalpopupextender When Using in a a Web Form with master Page

$
0
0

The following code works fine when it is in a web form, but, it doesn't work if I have it on a form with master Page. I get a Null reference error on the highlighted line below.

<link href="css/ui-lightness/jquery-ui-1.8.21.custom.css" rel="stylesheet" type="text/css" /><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script><style type="text/css">
 .ModalPopupBG
{
    background-color: #666699;
    filter: alpha(opacity=50);
    opacity: 0.7;
}

.HellowWorldPopup
{
    min-width:200px;
    min-height:150px;
    background-color:burlywood;
    border-width: 3px;
    border-style: solid;
    border-color: brown;
}
.PopupHeader
{
    background:green;
    background-color:navy;
    color:yellow;
}
</style><script>
    function onModalOk()
    {document.getElementById("TextBox2").innerText = document.getElementById('TextBox1').innerText;
        document.getElementById("TextBox3").innerText = $("#ddlEmp option:selected").text();
    }</script><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><asp:TextBox ID="TextBox3" runat="server"></asp:TextBox><asp:button id="Button1" runat="server" text="Button" /><ajaxToolkit:modalpopupextender id="ModalPopupExtender1" runat="server"
            OnOkScript="onModalOk();"
	        cancelcontrolid="btnCancel" okcontrolid="btnOkay"
	        targetcontrolid="Button1" popupcontrolid="Panel1"
	        popupdraghandlecontrolid="PopupHeader" drag="true"
	        backgroundcssclass="ModalPopupBG"></ajaxToolkit:modalpopupextender><asp:panel id="Panel1" style="display: none" runat="server"><div class="HellowWorldPopup"><div class="PopupHeader" id="PopupHeader">People Search</div><div class="popup_Body"><p>Enter you name:<asp:textbox id="TextBox1" runat="server"  AutoCompleteType="Disabled"></asp:textbox></p><p><asp:Label ID="lblCompany" runat="server" Text="Company:"></asp:Label><asp:DropDownList ID="ddlEmp" runat="server" AutoPostBack="true"><asp:ListItem Text="Company1" Value="1"></asp:ListItem><asp:ListItem Text="Company2" Value="2"></asp:ListItem></asp:DropDownList></p></div><div class="Controls"><input id="btnOkay" type="button" value="Done" /><input id="btnCancel" type="button" value="Cancel" /></div></div></asp:panel>

Javascript I can not access in the second view elements(textBoxs) reference.

$
0
0

I can not access in the second view elements(textBoxs) reference . why it could be

<body onload="show()" >
<form id="form1" runat="server">
<div>
<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="View1" runat="server">

<table class="auto-style1">
<tr>
<td class="baslik">Adı </td>
<td>
<asp:TextBox ID="a1" runat="server" ClientIDMode="Static" Width="300px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style2">Soyadı</td>
<td class="auto-style3" id="a2">
<asp:TextBox ID="a2" runat="server" ClientIDMode="Static" Width="300px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style6">Memleket</td>
<td class="auto-style7">
<asp:TextBox ID="a3" runat="server" ClientIDMode="Static" TextMode="MultiLine" Width="300px"></asp:TextBox>
</td>
</tr>
</table>

</asp:View>
<asp:View ID="View2" runat="server">
<table class="auto-style1">
<tr>
<td class="baslik">Meslek</td>
<td>
<asp:TextBox ID="b1" runat="server" ClientIDMode="Static" Width="300px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style4">Mezuniyet</td>
<td class="auto-style5">
<asp:TextBox ID="b2" runat="server" ClientIDMode="Static" OnTextChanged="TextBox5_TextChanged" Width="300px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="baslik">Branş</td>
<td>
<asp:TextBox ID="b3" runat="server" ClientIDMode="Static" TextMode="MultiLine" Width="300px"></asp:TextBox>
</td>
</tr>
</table>
</asp:View>
</asp:MultiView>
</div>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="1. Aşama" />
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="2. Aşama" />
</form>
</body>

Javascript code


function show() {
var txt = new Array();
var alan = ['a1','a2','a3','b1','b2','b3'];

for (var i = 0; i < alan.length; i++) { 
txt[i]=document.getElementById(alan[i]);
txt[i].addEventListener("keyup", wsss, true);
}
alert(txt.length);
}
function wsss(e){

alert("Mesaj"); // this method not work at the second view elements(textBox)
}

formatting map array

$
0
0

hi all

<input id="grndsrc" type="checkbox" name="advsrc" checked /><input id="fnamesrc" type="checkbox" name="advsrc" /><input id="lnamesrc" type="checkbox" name="advsrc" /><input id="dobsrc" type="checkbox" name="advsrc" /><input id="telsrc" type="checkbox" name="advsrc" /><input id="ssnsrc" type="checkbox" name="advsrc" />

this current code maps the above checkbox group

function detectsrc() {
                var checked = $(":checkbox[name='advsrc']").map(function (idx, ele) {
                    return (ele.checked) ? { id: this.id, val: $('#RegSrc' + 'srcctl').val() } : { id: this.id, val: '' };
                }).get();
                return (JSON.stringify(checked));
}

output is 

[{"id":"grndsrc","val":"a"},{"id":"fnamesrc","val":"null"},{"id":"lnamesrc","val":"null"},{"id":"dobsrc","val":"null"},{"id":"telsrc","val":"null"},{"id":"ssnsrc","val":"null"}]

I want the output looks like this

{"grndsrc":"a","fnamesrc":"","lnamesrc":"","dobsrc":"","telsrc":"","ssnsrc":""}



Link Button Behavior in a GridView for Modal Popup

$
0
0

I have a GridView in a usercontrol which gets data dynamically from a data table; a new column is added to GridView1 when during DataBind. I am having an issue and need help with:
When Link Button is clicked; the html for the Popup is displayed on the main page first and then the Popup shows up and the html for popup disappear.

What am I doing wrong?

protected void Page_Load(object sender, EventArgs e)
        {
	     if(!IsPostBack)
              {
                 this.BindGrid();
              }
        }

        private void BindGrid()
        {
            string constr = ConfigurationManager.ConnectionStrings["ConnString"].ConnectionString;
            using (SqlConnection con = new SqlConnection(constr))
            {
                using (SqlCommand cmd = new SqlCommand("SELECT * FROM Employees"))
                {
                    using (SqlDataAdapter sda = new SqlDataAdapter())
                    {
                        cmd.Connection = con;
                        sda.SelectCommand = cmd;
                        using (DataTable dt = new DataTable())
                        {
                            dt.Columns.AddRange(new DataColumn[1] { new DataColumn("View", typeof(int)) });
                            sda.Fill(dt);
                            GridView1.DataSource = dt;
                            GridView1.DataBind();
                        }
                    }
                }
            }
        }

        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                LinkButton lnkView = new LinkButton();
                lnkView.ID = "lnkActions";
                lnkView.Text = "View";
                lnkView.Click += ViewDetails;
                lnkView.CommandArgument = (e.Row.DataItem as DataRowView).Row["EmpID"].ToString();
                e.Row.Cells[0].Controls.Add(lnkView);
            }
        }
        protected void ViewDetails(object sender, EventArgs e)
        {
            LinkButton lnkActions = (LinkButton)sender;
            lnkActions.OnClientClick = "return false";
            GridViewRow row = (lnkActions.NamingContainer as GridViewRow);
            string sEmpID = lnkActions.CommandArgument;
            string name = row.Cells[2].Text;

            mpeThePopup.Show();
        }

Export to Excel Won't Work

$
0
0

I have a modal popup with a button control. When this button is clicked, I execute the following code which gets executed without any error but it won't ask to open or save the file. Also the excel file is not created, instead I see an diagnostic xml file having reference to this filename when I search for the file.

            Response.Clear();
            Response.Buffer = true;
            Response.ContentType = "application / vnd.ms - excel";
            Response.AddHeader("content - disposition", "attachment; filename = MyFiles.xls");
            Response.Charset = "";
            this.EnableViewState = false;

            System.IO.StringWriter sw = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);

            dgCurrentPoBdetails.RenderControl(htw);

            Response.Write(sw.ToString());
            Response.End();

I've tried using the following code; it does create an Excel file but does not prompt me to open or save. Also, I am not able to open up this file; it give me an error "Excel cannot open this file because the file format of the file extension is invalid"

            System.IO.StringWriter sw = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);

            // Render grid view control.
            dgCurrentPoBdetails.RenderControl(htw);

            // Write the rendered content to a file.
            string renderedGridView = sw.ToString();
            System.IO.File.WriteAllText(@"C:\MoQ\ExportedFile.xlsx", renderedGridView);
            string myStringVariable = "File saved to: " + "C:\\MyPath\\ExportedFile.xlsx";
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(" + myStringVariable + ")", true);


Permission Error + File Uploader

$
0
0

I am using the Ajax File Uploader, the site (ASP.net WebForms) is running as network service and it has permissions to the stated folder but it still causes an error

System.UnauthorizedAccessException: Access to the path 'C:\Windows\TEMP\_AjaxFileUpload' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
   at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
   at AjaxControlToolkit.AjaxFileUpload.BuildRootTempFolder()
   at AjaxControlToolkit.AjaxFileUpload.UploadRequestProcessor.XhrDone(String fileId)
   at AjaxControlToolkit.AjaxFileUpload.UploadRequestProcessor.ProcessRequest()
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.AddedControl(Control control, Int32 index)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


<act:AjaxFileUpload ID="actFileUplad" MaximumNumberOfFiles="1" CssClass="paddingleft1 margintop15" Width="343px" OnUploadComplete="OnUploadComplete" runat="server" Mode="Auto" />

Using Ajaxtoolkit in Cel phone web app

$
0
0

I´m making aspx web app, and I use ModalPopUpExtender, I like to drag it and it work fine in several explorers in computers.
But when I try to drag from explorer (Chrome) in cel phone (Android) explorer, don´t catch touch move event and dragging don´t work.
I make JavaScript function and I catched touchmove event but I don´t know how to call drag function.
Does anybody know how to call it?
Regards,


JP Serafini

Modal Popup Won't Center

$
0
0

I've read many articles to resolve my issue but still not being able to display the modal popup horizontally centered. I have added the following directive but didn't help.

Initially, popup is displayed on the left edge of the page but it centers automatically the moment I expand or shrink the page since I have added RepositionMode="RepositionOnWindowResize" to the extender.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Help getting AJAX to work on my hosting site GoDaddy

$
0
0

I want to use AJAXToolkit that GoDaddy says they support.  I am running on a Windows Hosting Site.  The AJAX tools work on my development workstation in all browsers.  But when I port the page to my hosting site I get a Parsing Error.  I think I need to add some configuration to my hosting web.config file but I am unable to find dependable documentation.  I am also confused about the difference between AJAX and JQUERY since they seem to be referenced together on Microsoft.  Can someone help clarify the difference and help me figure out what I need to do to get this working on my hosting site.  I really need to have some of the features that Jquery and AJAX provides.  Your assistance is greatly appreciated.  Many thanks in advance. 

modalpopupextender popup with multiple panels and action buttons

$
0
0

I have a main for with 5 textbox controls and a modalpopupextender modal popup with two panels, one for a Search Criteria and the other for a Gridview.

The first panel is a search criteria with a "Search", a "Cancel" and an "OK" button. When "Search" button is clicked, I need to to be able to search database and bind Gridview based on the search result. And then I can select a record in the Gridview and click on "OK" button to save Gridview data to textboxes in the main form.

I have reviewed the following article but it is not what I am looking for.

Scroll To View

$
0
0

I have a treeview inside a tab in a modalpopupextender, I have a routine which selects and expands a node based on the user search, the issue I have is it will not scroll in to view.

i have tried numerous ways but to no avail, last effort was this, after the search happens I call this function 

    private void SetJavaScriptSearch()
        {
            //string stv = @"var elem = document.getElementById('{0}_SelectedNode');
            //            if(elem != null )
            //            {
            //                var node = document.getElementById(elem.value);
            //                if(node != null)
            //                {
            //                        node.scrollIntoView(true);
            //                }
            //            }";

            string stv = @"var elem = document.getElementById('sitecontent_tabs_tpDetails_tvGenerict38');
                        if(elem != null )
                        {
                            var node = document.getElementById(elem.value);
                            if(node != null)
                            {
                                    node.scrollIntoView(true);
                            }
                        }";

            //ScriptManager.RegisterStartupScript(this, GetType(), "myscript", stv.Replace("{0}", tvGeneric.ClientID), true);

            ScriptManager.RegisterStartupScript(this, GetType(), "myscript", stv, true);

        }

Here is the page

<a class="selectedNode treeNode treeNode" id="sitecontent_tabs_tpDetails_tvGenerict38" style="text-decoration: none;" href="javascript:__doPostBack('ctl00$sitecontent$tabs$tpDetails$tvGeneric','s80')">Test Category</a>

Error Passing Value from a Modal Popup in ascx

$
0
0

The following code works fine if it is in an aspx form but it returns a NULL reference for innertext error if it is in an ascx form:

<link href="css/ui-lightness/jquery-ui-1.8.21.custom.css" rel="stylesheet" type="text/css" /><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script><style type="text/css">
 .ModalPopupBG
{
    background-color: #666699;
    filter: alpha(opacity=50);
    opacity: 0.7;
}

.HellowWorldPopup
{
    min-width:200px;
    min-height:150px;
    background-color:burlywood;
    border-width: 3px;
    border-style: solid;
    border-color: brown;
}
.PopupHeader
{
    background:green;
    background-color:navy;
    color:yellow;
}
</style><script>
    function onModalOk()
    {
        document.getElementById("TextBox2").innerText = document.getElementById('TextBox1').innerText;
        document.getElementById("TextBox3").innerText = $("#ddlEmp option:selected").text();
    }</script><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><asp:TextBox ID="TextBox3" runat="server"></asp:TextBox><asp:button id="Button1" runat="server" text="Button" /><ajaxToolkit:modalpopupextender id="ModalPopupExtender1" runat="server"
            OnOkScript="onModalOk();"
	        cancelcontrolid="btnCancel" okcontrolid="btnOkay"
	        targetcontrolid="Button1" popupcontrolid="Panel1"
	        popupdraghandlecontrolid="PopupHeader" drag="true"
	        backgroundcssclass="ModalPopupBG"></ajaxToolkit:modalpopupextender><asp:panel id="Panel1" style="display: none" runat="server"><div class="HellowWorldPopup"><div class="PopupHeader" id="PopupHeader">People Search</div><div class="popup_Body"><p>Enter you name:<asp:textbox id="TextBox1" runat="server"  AutoCompleteType="Disabled"></asp:textbox></p><p><asp:Label ID="lblCompany" runat="server" Text="Company:"></asp:Label><asp:DropDownList ID="ddlEmp" runat="server" AutoPostBack="true"><asp:ListItem Text="Company1" Value="1"></asp:ListItem><asp:ListItem Text="Company2" Value="2"></asp:ListItem></asp:DropDownList></p></div><div class="Controls"><input id="btnOkay" type="button" value="Done" /><input id="btnCancel" type="button" value="Cancel" /></div></div></asp:panel>


HTML Text Editor not updating the text

$
0
0

Hi im usig Winnthusiasm.HTML editor,

<cc1:HtmlEditor ID="txtNote" Height="200px" Toolbars="Select#Format,Select#Font,Select#Size:ForeColor,BackColor;Bold,Italic,Underline:Left,Center,Right,Justify|OrderedList,BulletedList|Indent,Outdent|Rule|Subscript,Superscript:"
                                        runat="server" ToggleMode="None" />

and trying to Update text to DB but not it is bringing Null to

 businessUnitEntity.Notes = txtNote.Text.ToString(); 

Can some one suggest me any events like texchange or some thing i need to work out?

AJAX TabControl HeaderText too small for Text display

$
0
0

I have a  AJAX TabControl the text in the header text is not showing the text is very small, i have set the height and width of the TabPanel still it not showing, the web page is a content page of a mother masterpage

please kindly advice me how to correct it

Modal Popup With CheckBoxList Control

$
0
0

I have a modal popup containing a CheckBoxList (AutoPostBack=true) and a label control in it. When I click on one of the checkbox to check or uncheck; the popup close automatcally since autopostback is set to true.  How do I keep the popup up while clicking on checkboxes?

Basically, I want to be able to execute the code in CheckBoxList _SelectedIndexChanged every time a checkbox is clicked; setting autopostback to false won't execute this code.

Nested JSON Serialization

$
0
0

Dear all

I m using stored procedure/Vb.net

I have two related tables shown below.

Relational Tables - SQL Server

I need to create one JSON array for them in this format, 

{"IDCtry":1,"CtryName":"Germany": ["StateID":1,"StateName":"Duesseldorf"],"DCtry":2,"CtryName":"spain": ["StateID":1,"StateName":"Barcelona"],
}

I can already serialize one table using the following method

<WebMethod()> _<ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=False, XmlSerializeString:=False)> _
    Public Function populateCtls(ByVal CtlName As String)
        Dim constr As String = ConfigurationManager.ConnectionStrings("ARTSQLConStrng").ConnectionString
        Using con As New SqlConnection(constr)
            Using cmd As New SqlCommand("populateCtls", con)
                cmd.CommandType = CommandType.StoredProcedure
                cmd.Parameters.Add("@operator", SqlDbType.NVarChar).Value = CtlName
                cmd.Connection = con
                Dim ds As New DataSet()
                Using sda As New SqlDataAdapter(cmd)
                    sda.Fill(ds)
                End Using
                Dim jsondata As String = JsonConvert.SerializeObject(ds)
                Return jsondata
            End Using
        End Using
    End Function

but i cant figure out how to relate these records before serialization.

Shall I run two sql readers for two different select statements or is there a way to join them before I serialize the returned result,

currently I use stored procedures (PopulateCtls) which has my select statement.

 

SlideShowExtender - when I click image rediret to product

$
0
0

Hi

I have one SlideShowExtender and when I click in one image I want to be redirected toproduct page. I tought That I can use the

ImageDescriptionLabelID="lblDescricao" or ImageTitleLabelID="lblTitulo" 

to write the link and redirect with 

Response.RedirectPermanent(lblDescricao.Text);

But that is not possible, the content of lblDescricao is empty.

Here is my aspx code:

<!-- script imagens --><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:ImageButton ID="ImageButton4" OnClick="LinkProduto" ImageUrl="imagens_carousel/imagem1.jpg" Width="200px" Height="200px" CssClass="img-responsive img-thumbnail" runat="server"
               /><span>    <asp:Label ID="lblTitulo" runat="server" Font-Bold="True" Font-Overline="False" Font-Size="X-Large"  ForeColor="#FF3300" Visible="true"></asp:Label><asp:Label ID="lblDescricao" runat="server" Font-Bold="True" Font-Size="X-Large" ForeColor="#FF3300" Visible="true"></asp:Label>     </span><ajaxToolkit:SlideShowExtender ID="SlideShowExtender1"
           TargetControlID="ImageButton4" runat="server" AutoPlay="true"
           Loop="true" SlideShowServicePath="imagens.asmx"
           SlideShowServiceMethod="GetSlides" ImageDescriptionLabelID="lblDescricao" ImageTitleLabelID="lblTitulo"
           /><!-- fim script imagens --> 

And my web method

 [WebMethod]
    public AjaxControlToolkit.Slide[] GetSlides()
    {
        return new AjaxControlToolkit.Slide[] {
            new AjaxControlToolkit.Slide("imagens_carousel/imagem1.jpg", "Portes Grátis", "http://mariolopes.com"),
            new AjaxControlToolkit.Slide("imagens_carousel/imagem2.jpg", "Portes Grátis", "http://ccccc.com"),
            new AjaxControlToolkit.Slide("imagens_carousel/imagem3.jpg", "Portes Grátis", "etc etc"),
            new AjaxControlToolkit.Slide("imagens_carousel/imagem4.jpg", "Portes Grátis", "etc etc"),
            new AjaxControlToolkit.Slide("imagens_carousel/imagem5.jpg", "Portes Grátis", "links here")};
    }

any ideas?

Thank you

Viewing all 5678 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>