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

Issue making use of sample project VBASPNETShowSpinnerImage

$
0
0

See URL "https://code.msdn.microsoft.com/VBASPNETShowSpinnerImage-53ce1d10"

This project works find standalone but when I add it to my website it fails.

I have solved one issue by changing the javascript in the user control as follows :-

Was

var img = document.getElementById("PopupProgressUserControl_imgProgress");

Changed to

var img = document.getElementById('<%=imgProgress.ClientID %>');

In the sample project the aspx page containing the user control "PopupProgressUserControl" there is a button called btnRefresh with attribute OnClientClick="document.getElementById('PopupProgressUserControl_btnLink').click();"

This works fine in the standalone project.

In my Website the relevent button is btnUpdateDeliveryDates.  This button does nothing related to the website. It initiates a long running database update process.

My desire is to lock the webpage and put up a wait symbol while the process is running.

On this button I have tried:-

OnClientClick="document.getElementById('PopupProgressUserControl_btnLink').click();"

OnClientClick="document.getElementById('<%=PopupProgressUserControl_btnLink.ClientID %>').click();"

OnClientClick="document.getElementById('btnLink.ClientID').click();"

In all cases I get :-

JavaScript runtime error: Unable to get property 'click' of undefined or null reference

How can I raise btnLink's click event ?

My aspx page is as per below:

<%@ Page Language="VB" AutoEventWireup="false" MasterPageFile="~/MasterPage.master" CodeFile="ForkliftBatteryRegister.aspx.vb" Inherits="ForkliftBatteryRegister" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register src="UserControl/PopupProgress.ascx" tagname="PopupProgress" tagprefix="uc1" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">


<asp:Label ID="lblPageHeading" runat="server" CssClass="HeadingText"
Text="Forklift Battery Register" style="height: 16px;top: 130px; width: 262px"></asp:Label>

<asp:Label ID="lblUpdateProgress" runat="server" CssClass="FieldLabel" style="z-index: 1; left: 1039px; top: 348px; position: absolute; width: 291px; height: 17px"></asp:Label>

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>


<asp:SqlDataSource ID="SqlDataSourceForkliftMake" runat="server"
ConnectionString="<%$ ConnectionStrings:ExideConnectionString %>"

SelectCommand="SELECT DISTINCT Make FROM [FL Make and Model] ORDER BY Make"
OldValuesParameterFormatString="Original_{0}"
ViewStateMode="Enabled">
</asp:SqlDataSource>


<asp:Button ID="btnAddNewBattery" runat="server" Style="z-index: 1; left: 1037px; top: 367px;
position: absolute; height: 30px; width: 156px"
Text="Add New Item" Height="30px" />





<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>


<asp:GridView ID="grdForkliftBatteryRegister" runat="server" Style="z-index: 1;
left: 286px; top: 414px; position: absolute; width: 910px; "
AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="FL_Battery_Serial_Number"
ViewStateMode="Enabled" CaptionAlign="Left" BorderStyle="Dotted"
AutoGenerateSelectButton="True" PageSize="20">
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" Wrap="False" />
<Columns>
<asp:BoundField DataField="FL_Battery_Serial_Number" HeaderText="Serial Number"
ReadOnly="True" SortExpression="FL_Battery_Serial_Number" />
<asp:BoundField DataField="FL_State" HeaderText="State" ReadOnly="True"
SortExpression="FL_State" />
<asp:BoundField DataField="FL_Customer_Number" HeaderText="Customer No"
ReadOnly="True" SortExpression="FL_Customer_Number" />
<asp:BoundField DataField="FL_Customer_Name" HeaderText="Customer Name" />
<asp:BoundField DataField="FL_Date_Promised" DataFormatString="{0:dd-MMM-yy }"
HeaderText="Date Promised" ReadOnly="True" SortExpression="FL_Date_Promised" />
<asp:BoundField DataField="FL_Location_Building" HeaderText="Location Building"
ReadOnly="True" SortExpression="FL_Location_Building" />
<asp:BoundField DataField="FL_Forklift_Serial_Number"
HeaderText="Forklift Serial No" ReadOnly="True"
SortExpression="FL_Forklift_Serial_Number" />
<asp:BoundField DataField="FL_Make" HeaderText="Make" ReadOnly="True"
SortExpression="FL_Make" />
<asp:BoundField DataField="FL_Model" HeaderText="Model" />
<asp:BoundField DataField="FL_Battery_Item_Code" HeaderText="Battery Item Code"
ReadOnly="True" SortExpression="FL_Battery_Item_Code" />
<asp:BoundField DataField="FL_Containing_Cell" HeaderText="Containing Cell"
ReadOnly="True" SortExpression="FL_Containing_Cell" />
<asp:BoundField DataField="FL_Cell_Qty" HeaderText="Cell Qty" ReadOnly="True"
SortExpression="FL_Cell_Qty" />
</Columns>
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Left" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>


<asp:SqlDataSource ID="SqlDataSourceBatteryRegister" runat="server"
ConnectionString="<%$ ConnectionStrings:ExideConnectionString %>"

SelectCommand="SELECT [FL_Battery_Serial_Number], [FL_State], [FL_Customer_Number], [FL_Customer_Name], [FL_Location_Building], [FL_Make], [FL_Model], [FL_Battery_Item_Code], [FL_Containing_Cell], [FL_Cell_Qty], [FL_Forklift_Serial_Number] FROM [FL Battery Register]">
</asp:SqlDataSource>


<asp:UpdatePanel ID="UpdatePanel" UpdateMode="Conditional" runat="server">
<ContentTemplate>

<asp:Button ID="btnUpdateDeliveryDates" OnClick="btnUpdateDeliveryDates_Click"
runat="server" Style="z-index: 1; left: 1039px; top: 317px;
position: absolute; height: 30px; width: 157px" Text="Update Delivery Dates" Height="30px"




OnClientClick="document.getElementById('<%=PopupProgressUserControl_btnLink.ClientID %>').click();" />

</ContentTemplate>
</asp:UpdatePanel>

<asp:UpdateProgress ID="updateProgress" runat="server" AssociatedUpdatePanelID="updatePanel">
</asp:UpdateProgress>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>

<asp:CheckBoxList ID="chkBoxList" runat="server" Style="z-index: 1; left: 281px;
top: 151px; position: absolute; height: 178px; width: 179px"
AutoPostBack="True">
<asp:ListItem Value="1">A Particular Battery</asp:ListItem>
<asp:ListItem Value="10">Date Range</asp:ListItem>
<asp:ListItem Value="100">Make</asp:ListItem>
<asp:ListItem Value="100000">State</asp:ListItem>
<asp:ListItem>Customer Name</asp:ListItem>
<asp:ListItem Value="Location Building"></asp:ListItem>
<asp:ListItem>Item Type</asp:ListItem>
<asp:ListItem>Forklift Serial Number</asp:ListItem>
<asp:ListItem>Not Delivered</asp:ListItem>
<asp:ListItem>Model</asp:ListItem>
</asp:CheckBoxList>


<asp:Label ID="lblParticularBattery" runat="server" CssClass="FieldLabel" Style="z-index: 1;
left: 460px; top: 150px; position: absolute; height: 18px; width: 175px" Text="Enter Battery Serial No :"
Visible="False" Height="20px"></asp:Label>
<asp:TextBox ID="txtAParticularBattery" runat="server" Style="z-index: 1; left: 645px;
top: 150px; height: 18px; position: absolute" Visible="False" Height="20px"></asp:TextBox>



<asp:Label ID="lblFromDate" runat="server" CssClass="FieldLabel" Style="z-index: 1;
left: 511px; top: 175px; position: absolute; height: 18px; width: 125px;" Text="From Date :"
Visible="False" Height="20px"></asp:Label>
<asp:TextBox ID="txtFromDate" runat="server" CssClass="FieldValue" Style="z-index: 1;
left: 645px; top: 175px; position: absolute; height: 18px; width: 100px"
Visible="False" Height="20px"></asp:TextBox>
<asp:CalendarExtender ID="txtFromDate_CalendarExtender" runat="server" CssClass="MyCalendar1"
Format="dd/MM/yyyy" PopupButtonID="ImageFromDate" TargetControlID="txtFromDate">
</asp:CalendarExtender>

<asp:Image ID="ImageFromDate" runat="server" ImageUrl="~/Images/Calendar_scheduleHS.png"
Style="z-index: 1; left: 750px; top: 175px; position: absolute; height: 18px;
width: 18px" Visible="False" />

<asp:Label ID="lblToDate" runat="server" CssClass="FieldLabel" Style="z-index: 1;
left: 770px; top: 175px; position: absolute; height: 18px; width: 80px;" Text="To Date :"
Visible="False" Height="20px"></asp:Label>
<asp:TextBox ID="txtToDate" runat="server" Style="z-index: 1; left: 855px; top: 175px;
position: absolute; height: 18px; width: 100px" CssClass="FieldValue"
Visible="False" Height="20px"></asp:TextBox>
<asp:CalendarExtender ID="txtToDate_CalendarExtender" runat="server" CssClass="MyCalendar1"
PopupButtonID="ImageToDate" TargetControlID="txtToDate"
Format="dd/MM/yyyy">
</asp:CalendarExtender>

<asp:Image ID="ImageToDate" runat="server" ImageUrl="~/Images/Calendar_scheduleHS.png"
Style="z-index: 1; left: 960px; top: 175px; position: absolute; height: 18px;
width: 18px" Visible="False" />

<asp:Label ID="lblMake" runat="server" CssClass="FieldLabel"
style="z-index: 1; left: 511px; top: 200px; position: absolute; width: 125px; height: 18px"
Text="Make :" Visible="False"></asp:Label>

<asp:DropDownList ID="ddlMake" runat="server" CssClass="FieldValue"
DataTextField="Make" DataValueField="Make" Style="z-index: 1; left: 645px;
top: 200px; position: absolute; height: 24px; width: 240px" Visible="False"
DataSourceID="SqlDataSourceForkliftMake" Height="20px">
</asp:DropDownList>

<asp:Label ID="lblState" runat="server" CssClass="FieldLabel" Style="z-index: 1;
left: 511px; top: 225px; position: absolute; height: 18px; width: 125px; bottom: 538px"
Text="State :" Visible="False" Height="20px"></asp:Label>

<asp:DropDownList ID="ddlState" runat="server" CssClass="FieldValue" Style="z-index: 1;
left: 645px; top: 225px; position: absolute; height: 24px; width: 69px"
Visible="False" DataTextField="State"
DataValueField="State" Height="20px">
<asp:ListItem>NSW</asp:ListItem>
<asp:ListItem>VIC</asp:ListItem>
<asp:ListItem>QLD</asp:ListItem>
<asp:ListItem>SA</asp:ListItem>
<asp:ListItem>WA</asp:ListItem>
</asp:DropDownList>

<asp:Label ID="lblCustomer" runat="server" CssClass="FieldLabel"
style="z-index: 1; left: 511px; top: 250px; position: absolute; width: 125px; height: 18px"
Text="Customer :" Visible="False" Height="20px"></asp:Label>

<asp:TextBox ID="txtCustomer" runat="server"
Style="z-index: 1; left: 645px;
top: 250px; height: 18px; position: absolute" Visible="False" Height="20px"></asp:TextBox>

<uc1:PopupProgress ID="PopupProgressUserControl" runat="server" />

<asp:Label ID="lblLocation_Building" runat="server" CssClass="FieldLabel"
style="z-index: 1; left: 511px; top: 275px; position: absolute; width: 125px; height: 18px"
Text="Location Building :" Visible="False" Height="20px"></asp:Label>

<asp:TextBox ID="txtLocationBuilding" runat="server"
Style="z-index: 1; left: 645px;
top: 275px; height: 18px; position: absolute" Visible="False" Height="20px"></asp:TextBox>


<asp:Label ID="lblItemType" runat="server" CssClass="FieldLabel"
style="z-index: 1; left: 511px; top: 300px; position: absolute; width: 125px; height: 18px"
Text="Item Type :" Visible="False" Height="20px"></asp:Label>

<asp:DropDownList ID="ddlItemType" runat="server" CssClass="FieldValue" Style="z-index: 103; left: 645px; position: absolute; top: 300px"
Width="200px" SelectedValue='<%# Bind("FL_Item_Type") %>'
Height="24px">
<asp:ListItem>Battery</asp:ListItem>
<asp:ListItem>Charger</asp:ListItem>
<asp:ListItem>Maintenance Free</asp:ListItem>
</asp:DropDownList>

<asp:Label ID="lblForkliftSerialNumber" runat="server" CssClass="FieldLabel"
style="z-index: 1; left: 385px; top: 325px; position: absolute; width: 249px; height: 18px"
Text="Forklift Serial Number :" Visible="False" Height="20px"></asp:Label>

<asp:TextBox ID="txtForkliftSerialNumber" runat="server"
Style="z-index: 1; left: 645px;
top: 325px; height: 18px; position: absolute" Visible="False" Height="20px"></asp:TextBox>


<asp:Label ID="lblModel" runat="server" CssClass="FieldLabel"
style="z-index: 1; left: 510px; top: 350px; position: absolute; width: 125px; height: 18px"
Text="Model :" Visible="False" Height="20px"></asp:Label>

<asp:TextBox ID="txtModel" runat="server"
Style="z-index: 1; left: 645px;
top: 350px; height: 18px; position: absolute" Visible="False" Height="20px"></asp:TextBox>


<asp:Button ID="btnRetrieveData" runat="server" Style="z-index: 1; left: 868px; top: 367px;
position: absolute; height: 30px; width: 157px" Text="Retrieve Data"
Height="30px" />

</ContentTemplate>
</asp:UpdatePanel>




</asp:Content>


Sys.WebForms.PageRequestManagerParserErrorException: issue in .NET framework 4.5.2

$
0
0

Hello Team,

Throughout the application we are getting below error.On button click event, drop down selected index change event , check box changed event, text changed event , radio button checked change event(especially during post back of the page).

Error Msg: "Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.Common causes for this error are when the response is modified by class to Response.Write(),response filters,HttpModules, or server trace is enabled. Details : Error parsing near 'ect the following:"|e_ButtonImg" src="Im"."

We are using AjaxtoolKit 4.0 version. I suspect that this is causing related to update panel's partial rendering issue in IE9. 

Note : i tried with below code inside page load  event my issue resolved  and it's working fine. Like wise i need to do for all server side changed event. instead of that is it possible to provide fix in web.config file ?

Code fix :

ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);

scriptManager.RegisterPostBackControl(this.btnSave);

Like wise i have to add code for all pages for remaining asp.net server controls. Could you please provide high priority on this issue and help us toresolve this issue in a generic way.

Thanks much.

Sara.

PostBackTrigger and UpdateProgress

$
0
0

hi everybody,

i'm having problems with updateprogress, i'm using a Postbacktrigger to load my excel file. I tried Asyncpostback but the file upload doesn't work with that. Everythings works fine except for updateprogress. (I know it can't work with PostbackTrigger.. but i absolutely need it, cause my file is huge and it takes a long time to load. I can't use a fixed timeout). Now i'm trying to start updateprogress onclientclick but.. i don't know how to stop it! I would stop it when file upload ends. Any ideas? THANK YOU!!!!

this is what i'm using to start Updateprogress:

<asp:UpdatePanel runat="server" ID="updButton" >
<ContentTemplate>
<asp:ImageButton runat="server" ID="provaexcel" ImageUrl="~/Images/ImmagineExcel.png"
OnClick="provaexcel_Click" OnClientClick="postbackButtonClick()" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="provaexcel" />
</Triggers>

</asp:UpdatePanel>


function postbackButtonClick() {
updateProgress = $find("<%= UpdateProgress15.ClientID %>");
window.setTimeout("updateProgress.set_visible(true)", updateProgress.get_displayAfter());
return true;
}


<asp:UpdatePanel runat="server" ID="provaupd15">
<ContentTemplate>

<div class="indicator" id="divclassProgress15" runat="server">
<asp:UpdateProgress ID="UpdateProgress15" runat="server" AssociatedUpdatePanelID="updButton"
DisplayAfter="0" DynamicLayout="true">
<ProgressTemplate>
<table class="loading">
<tbody>
<tr>
<td>

<asp:Image runat="server" ID="Comm_ind12" ImageUrl="~/App_themes/common/background/indicator.gif" />
<asp:Label CssClass="label" ID="Comm_porgress12" runat="server">
Attendere prego ......
</asp:Label>
</td>
</tr>
</tbody>
</table>
</ProgressTemplate>

</asp:UpdateProgress>
</div>

</ContentTemplate>
</asp:UpdatePanel>

dynamically set slider min and max values

$
0
0

Hi

I have a SQL query which will return the first and last years providing me a range.  

If I set the associated text box to the first year, this sets the minimum for the slider.

I then set the slider.maximum to the last year.

Unfortunately, the slider will not respond to input by the user.  Here is my code:

(FirstDate and LastDate are years formatted as a string and are found when I search the data base.  

The example I am working with FirstYear = "1600" and LastYear = "1615")

'now display range on slider as years
sliderStartLabel.Text = "Year " & FirstDate & " to "
slider_TextBox.Text = FirstDate
slider_TextBox_SliderExtender.Minimum = FirstDate

sliderEndLabel.Text = LastDate
slider_TextBox_SliderExtender.Maximum = LastDate

Any suggestions?  Thanks in advance for any help.

Ajax crash caused by lack of memory?

$
0
0

I have almost no experience or training in Ajax.  I was recently tasked with maintaining a C# MVC program that makes use of an Ajax call as the final step in the download process of a zip file.  It seems to be crashing when the incoming zip file has too many files.  As far as I can tell this is a conventional Ajax routine.  It has a 'Success:' section and an 'Error:' section. 

If the conditions are such that the system is working (just a few files),  I can put window.alert popups in the Success: section and observe the processing(inside the for loop, for example).  It the number/size of files is excessive (546 for example, in a 646 meg zip file) the system goes directly to the 'Error:' section without ever displaying my popups.

The errorThrown value is 'Internal Server Error'.  Beyond that I haven't found anything else so far.

Any suggestions for further troubleshooting?

The Ajax is as follows:

   $.ajax({
                url: url,
                type: 'POST',
                contentType: 'application/json',
                data: JSON.stringify({ ids: ids, themeId: themeId }),
                success: function (result) {
                    var form = $('<form method="POST" action="' + url + '">');

                    for (var i = 0, count = ids.length; i < count; i++) {
                        form.append($('<input type="hidden" name="ids[' + i + ']" value="' + ids[i] + '">'));
                    }
                    form.append($('<input type="hidden" name="themeId" value="' + themeId + '">'));

                    $('body').append(form);
                    form.submit();

                    $('.loader-wrap').hide();
                    $('.btn-pickup-download, .btn-pickup-download-all').removeClass('disabled');
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    $('.loader-wrap').hide();
                    $('.btn-pickup-download, .btn-pickup-download-all').removeClass('disabled');
                    alert('The requested report(s) is unavailable. If you have any questions, please contact your Account Manager.');
                }
            });

Calendar extender popup opens in wrong location in zoomed Chrome window on Android

$
0
0

Note: This bug has been also reported on the DevExpress GitHub for AjaxControlToolkit, where someone identified that the root cause of the problem is in the getLocation() method of the Ajax library.  Re-posting here to find out if there's a way to get that fixed.

https://github.com/DevExpress/AjaxControlToolkit/issues/285

Steps to reproduce bug:

  1. Using Chrome on Android, open the web page for the demo of the AJAX Control Toolkit Calendar extender:https://ajaxcontroltoolkit.devexpress.com/Calendar/Calendar.aspx

  2. Zoom the window to anything greater than 100% (e.g. 110%)

  3. Click the calendar button to open the popup

Expected behavior: Popup should open adjacent and aligned to the bottom of the input field (or the top if there is no visual room).

Actual behavior: Popup opens in location down and to the right of the associated input field, at a distance relative to the zoom level.

Analysis: [Credit to MikhailTymchukDX on DevExpress forum] Its root cause is the calculation of the element location. The calendar script uses the Popup script, which in turn uses the getLocation() method from the Microsoft Ajax library. If you check lines 4281 and 4282, you'll see that the bodyElement.scrollLeft and bodyElement.scrollTop properties are used:

offsetX =Math.round(clientRect.left) + (documentElement.scrollLeft||bodyElement.scrollLeft),
offsetY =Math.round(clientRect.top) + (documentElement.scrollTop||bodyElement.scrollTop);

These non-zero values cause a popup displacement when the browser is zoomed.

Workaround: A temporary workaround to this problem was identified over at Stack Overflow: http://stackoverflow.com/questions/12085123/ajax-calendarextender-displaying-at-wrong-position-in-google-chrome

They inserted a DIV around both the Calendar extender and the associated input field, and applied a "position: relative" style to the DIV. We confirmed this workaround does correct the problem, but may have other side effects that we're unaware of, and would prefer that someone identify and address the actual root cause.

One additional note: The problem with the popup opening in the wrong location only seems to appear in Chrome on Android. However, all browsers seem to have difficulty maintaining the alignment of the popup to the field when the browser is zoomed while the popup is open. Applying the aforementioned workaround actually also resolves this behavior, seeming to keep the popup properly aligned with the field in all browsers, even when someone zooms the browser window while the popup is open.

Is it a good idea to hard-code reading JSON data/values with the "d" __type?

$
0
0

This is my AJAX code:

{

	var temp = { ugh: "Yea" };
	var value = JSON.stringify({ hash: JSON.stringify(temp) });$.ajax({
		type: 'POST',
		url: 'BackgroundService.asmx/HandleData',
		contentType: 'application/json',
		data: value,
		success: function(result) {
			console.log(result);
		},
		error: function(error) {
			console.log("Error: " + error);
		}
	});

}


This is my [WebMethod]:

[WebMethod]
public string HandleData(string hash) {
	return "Hello world";
}


And this is the result I get when the AJAX succeeds:

Object {d: "Hello world"}



About this "d" __type, I have already looked online for solutions on removing this. As it turns out, most of the solutions didn't worked, and there are other solutions that either requires me to use a 3rd party library, or doesn't apply to me (dynamic linked libraries, etc.).

So, I've decided to keep the "d" __type with me. 

Right now, I have no idea how to remove the d. I'm willing to try other methods of removing the d. If you have ideas, please let me know.

Now, I want to know if hard-coding the returned JSON data with the "d" __type is acceptable. Since, inevitably, that d is always going to be there, might as well just write it into the code. Saves a lot of hassle during times when I have work constraints I need to reach.

Is it okay to hard-code the d in my code when I want to access the value of d in the returned JSON data?

HtmlEditorExtender not displaying formatted HTML markup.

$
0
0

I have strings from an external source like the following:

<p style="font-family: Times New Roman; font-size: 11pt; color: #000000; font-weight: normal; "><b><span style="font-family: 'Times New Roman', serif;">Critical Thinking Questions</span></b></p>< p style="font-family: Times New Roman; font-size: 11pt; color: #000000; font-weight: normal; "><b><span style="font-family: 'Times New Roman', serif;">Case 1-1</span></b></p>< p style="font-family: Times New Roman; font-size: 11pt; color: #000000; font-weight: normal; ">&#8203;</p>< p style="font-family: Times New Roman; font-size: 11pt; color: #000000; font-weight: normal; "><span style="font-size: 11pt; font-family: 'Times New Roman', serif;">Mark is given the responsibility of setting up a method for distributing information at the university where he works.</span></p>< p style="font-family: Times New Roman; font-size: 11pt; color: #000000; font-weight: normal; ">&#8203;</p><br /><div data-keepme="true" style="font-family: Times New Roman; font-size: 11pt; color: #000000; font-weight: normal; ">&#8203;<span style="font-size:11pt;font-family:'Times New Roman', serif;">The content that needs to be distributed will include course lists with student data, lecture notes, and slides that should be available only to the students in a given course. Which of the following technologies is the best choice for Mark?</span></div>

When I set the .Text field of my TextBox control to the above string, I see exactly the above in the HtmlEditorExtender control.  What I really want to see is this:

Critical Thinking Questions

Case 1-1

Mark is given the responsibility of setting up a method for distributing information at the university where he works.

The content that needs to be distributed will include course lists with student data, lecture notes, and slides that should be available only to the students in a given course. Which of the following technologies is the best choice for Mark?

Here is my code:

<asp:TextBox
Text="<%#:Item.HtmlText%>"
Height="200"
Width="75%"
CssClass="question-field-view"
TextMode="MultiLine"
ID="QuestionTextBox"
runat="server" />
<ajaxToolkit:HtmlEditorExtender
ID="Question_HtmlEditorExtender"
TargetControlID="QuestionTextBox"
runat="server" >
</ajaxToolkit:HtmlEditorExtender>

I have installed the following packages:

AjaxControlToolkit.16.1.1.0
AjaxControlToolkit.HtmlEditor.Sanitizer.16.1.1.0
AjaxControlToolkit.StaticResources.16.1.1.0
Antlr.3.4.1.9004
Antlr.3.5.0.2
AspNet.ScriptManager.bootstrap.3.3.7
AspNet.ScriptManager.jQuery.3.1.1
bootstrap.3.0.0
bootstrap.3.3.7
BuildBundlerMinifier.2.2.306
DotNetZip.1.10.1
EntityFramework.6.1.3
HtmlAgilityPack.1.4.9.5
jQuery.1.10.2
jQuery.3.1.1
jQuery.Validation.1.11.1
Microsoft.AspNet.FriendlyUrls.1.0.2
Microsoft.AspNet.FriendlyUrls.Core.1.0.2
Microsoft.AspNet.Identity.Core.2.2.1
Microsoft.AspNet.Identity.EntityFramework.2.2.1
Microsoft.AspNet.Identity.Owin.2.2.1
Microsoft.AspNet.Mvc.5.2.3
Microsoft.AspNet.Razor.3.2.3
Microsoft.AspNet.ScriptManager.MSAjax.5.0.0
Microsoft.AspNet.ScriptManager.WebForms.5.0.0
Microsoft.AspNet.Web.Optimization.1.1.3
Microsoft.AspNet.Web.Optimization.WebForms.1.1.3
Microsoft.AspNet.WebApi.5.2.3
Microsoft.AspNet.WebApi.Client.5.2.3
Microsoft.AspNet.WebApi.Core.5.2.3
Microsoft.AspNet.WebApi.HelpPage.5.2.3
Microsoft.AspNet.WebApi.Owin.5.2.3
Microsoft.AspNet.WebApi.WebHost.5.2.3
Microsoft.AspNet.WebPages.3.2.3
Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0
Microsoft.jQuery.Unobtrusive.Validation.3.2.3
Microsoft.Net.Compilers.1.0.0
Microsoft.Net.Compilers.1.3.2
Microsoft.Owin.3.0.1
Microsoft.Owin.Host.SystemWeb.3.0.1
Microsoft.Owin.Security.3.0.1
Microsoft.Owin.Security.Cookies.3.0.1
Microsoft.Owin.Security.Facebook.3.0.1
Microsoft.Owin.Security.Google.3.0.1
Microsoft.Owin.Security.MicrosoftAccount.3.0.1
Microsoft.Owin.Security.OAuth.3.0.1
Microsoft.Owin.Security.Twitter.3.0.1
Microsoft.Web.Infrastructure.1.0.0.0
Microsoft.WindowsAzure.ConfigurationManager.3.2.3
Modernizr.2.6.2
Modernizr.2.8.3
Newtonsoft.Json.6.0.4
Newtonsoft.Json.9.0.1
Owin.1.0
Respond.1.2.0
Respond.1.4.2
SharpFileSystem.1.0.0.37
SlowCheetah.Tasks.Unofficial.1.0.0
WebGrease.1.5.2
WebGrease.1.6.0

What am I missing here?  Is there some setting that need to set?


Cascading DropdownList Disable

$
0
0

Hello

I have cascading Dropdownlist gets populated with a Webservice and I need to disable that dropdownlist. I tried adding a handler but no use.

on aspx page

<script type="text/javascript">

 function pageLoad(sender, args) {
            $find("cddl").add_populated(DisableDDL);
        
        }

        function DisableDDL() {
          
            $get("ddlCountry").disabled = true;

</script>

//Control on PAGE

<tr><td> Select Country:</td><td>
           <asp:DropDownList ID="ddlCountry" runat="server"></asp:DropDownList>
           <asp:CascadingDropDown ID="CountryCascading" runat="server" Category="Country"  BehaviorID="cddl"
            TargetControlID="ddlCountry" LoadingText="Loading Countries..." PromptText="Select Country"
            ServiceMethod="BindCountry" ServicePath="testServ.asmx">
       </asp:CascadingDropDown> </td></tr>

I don't know what I'm missing. I really appreciates any insight.

Thanks

Rao

Can't get AutoCompleteExtender to work

$
0
0

Not sure what I'm doing wrong, but typing in the textbox produces nothing. Code below

<asp:TextBox ID="NewRoamerTB" runat="server" AutoPostBack="True"></asp:TextBox><ajaxToolkit:AutoCompleteExtender ID="NewRoamerTBACE" runat="server" TargetControlID="NewRoamerTB" ServiceMethod="GetStates" MinimumPrefixLength="1" DelimiterCharacters="" Enabled="True" CompletionInterval="200" EnableCaching="False" ServicePath="~/AutoComplete.asmx"></ajaxToolkit:AutoCompleteExtender>
AutoCompleteasmx.vb

Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.Services

Namespace AutoCompleteExample
    ' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
    <WebService([Namespace]:="http://tempuri.org/")><WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)><System.ComponentModel.ToolboxItem(False)><System.Web.Script.Services.ScriptService>
    Public Class AutoComplete
        Inherits System.Web.Services.WebService<WebMethod>
        Public Function GetStates(prefixText As String, count As Integer, contextKey As String) As List(Of String)
            Dim states As New List(Of String)() From {"Alaska","Alabama","California","North Dakota"
            }

            Return states
        End Function
    End Class
End Namespace

AutoComplete.asmx

<%@ WebService Language="vb" CodeBehind="AutoComplete.asmx.vb" Class="AutoCompleteExample.AutoComplete" %>

web.config

<remove verb="*" path="*.asmx"/><add verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory" validate="false"/>

MasterPage.master

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="True"><Services><asp:ServiceReference
       path="~/AutoComplete.asmx" /></Services></asp:ScriptManager>

How can I redirect the page when time out happens in asp.net.

$
0
0

Hi Every one,

I am having a Asp.net web Application.

I want to embed the time out functionality in my Application.

i.e If no activity is done I want to redirect when time out happens.

So I have added the code in the web config.

<sessionState timeout="10"></sessionState>

And In my Global.ascx at the

   void Session_End(object sender, EventArgs e)

        {

            Response.Redirect("~/Expired.aspx",false);

//Error Msg {"Response is not available in this context."}

          HttpContext.Current.Response.Redirect("~/Expired.aspx");

//Error Msg Object referenced to a null.  }

I am not sure what wrong in my code.

Any suggestions Pls.

 

handling arrow key events on textbox attached AutoCompleteExtender

$
0
0

Hi,

    I use arrow keys(up、down、left、right and enter) to switch focus between mutilple controls like textbox or dropdownlist.
It work fine.If I use an autocomplete textbox with Ajax AutoCompleteExtender and the Ajax AutoCompleteExtender show the
data.I press the up or down arrow key,it switch focus to next control and can not assign value from dropdown list to textbox.

I must know if the AutoCompleteExtender show any value(data) and avoid the up or down arrow key to switch focus to next control.

How can I know the AutoCompleteExtender show any value? Thanks.

How to access the value of asp:Textbox control that's witin in Accordion Pane from codebehind in c#

$
0
0

<ajaxToolkit:Accordion ID="Accordion2" runat="server" BackColor="#E5E5E5" Width="60%">
<Panes>

<ajaxToolkit:AccordionPane ID="AccordionPane1" runat="server">

<Header><Strong>Update Extras</Strong></Header>
<Content>

<asp:Label ID="lblTitle" runat="server" Text="Title:" Visible="true"></asp:Label>
<asp:TextBox ID="txtTitle" runat="server" Visible="true"></asp:TextBox>
<asp:Label ID="lblQty" runat="server" Text="Quantity:" Visible="true"></asp:Label>
<asp:TextBox ID="txtQty" runat="server" Visible="true" Width="70"></asp:TextBox>
<asp:Label ID="lblPrice" runat="server" Text="Price:" Visible="true"></asp:Label>
<asp:TextBox ID="txtPrice" runat="server" Visible="true" Width="70"></asp:TextBox>

</Content>
</ajaxToolkit:AccordionPane>

I want to grab the value of txtTitle from code behind. How do i go about it? Things I have tried:

TextBox txt = (TextBox)Accordion2.FindControl("AccordionPane1").FindControl("txtTitle");
string test1 = txt.Text;

TextBox tb2 = (TextBox)AccordionPane1.FindControl("txtTitle");
TextBox tb3 = (TextBox)Accordion2.FindControl("txtTitle");
string test2 = tb1.Text;
string test3 = tb2.Text;

string test4 = txtTitle.Text;

Chrome ignores font-size in the htmleditor in the ajaxcontroltoolkit

$
0
0

I have a webpage that has a htmleditor provided by the Ajax Control Toolkit. It works good in IE. I've tried all the buttons, and the underlying text is neatly stored in the database, including the tags for bold, font-size etc.

Now I've found out that Google Chrome works fine with bold for example, but completely ignores font-size or font-family.

The moment I highlight a piece of text and choose an button, it is fine. The moment I save it, it is gone.

By the way, font-size works fine in Firefox, font-family is also ignored.

I really need to get this working. Anyone any ideas?

ScriptResource Uncaught Error: Sys.ArgumentNullException: Value cannot be null. Parameter name: panelsCreated[1]

$
0
0

Hello All,

I have a perculiar error happening on a particular server , This issue isnt reproducible locally and also not happening on any other server . We have a page which has a couple of user controls and has a master page as well .

<%@ Page Language="C#" MasterPageFile="~/Client.master" AutoEventWireup="true"
Inherits="website.network.sales" CodeBehind="sales.aspx.cs" %>

<%@ Register tagPrefix="uc" tagName="Menusales" src="~/components/menu/menusales.ascx" %>
<%@ Register tagPrefix="uc" tagName="JobsaleSourceChart" src="~/components/network/Chart/JobsaleSourceChart.ascx" %>

<asp:Content ID="headercontent" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div id="printRegion">
</div>
<div id="nonPrintRegion">
<table cellpadding="0" cellspacing="0" border="0" style="clear: both">
<tr>
<td valign="top" width="210" bgcolor="#f2f2f2">
<uc:Menusales ID="Menusales" runat="server" />
</td>
<td width="735" valign="top">
<div id="holder2" class="summary">
<div id="summaryTop">
<uc:JobsaleSourceChart ID="chart" runat="server" />

This is the jobsale user control

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="JobsaleSourceChart.ascx.cs" Inherits="website.components.network.Chart.JobsaleSourceChart" %>

<%@ Register tagPrefix="uc" tagName="PageLoading" src="~/components/Common/PageLoading.ascx" %>
<%@ Register tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>

<asp:HiddenField ID="hdnJobID" runat="server" />
<asp:HiddenField ID="hdnChartType" runat="server" />

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<uc:PageLoading ID="pageLoading" runat="server" />
<style type="text/css">

.ui-daterangepicker-arrows .ui-daterangepicker-prev {
left: 2px;
}

.ui-daterangepicker-arrows .ui-daterangepicker-prev, .ui-daterangepicker-arrows .ui-daterangepicker-next {position: absolute;top: 2px;padding: 1px;}
.ui-daterangepicker-arrows .ui-daterangepicker-next {right: 2px;}
.ui-daterangepicker-arrows input.ui-rangepicker-input {width: 158px;margin: 0 2px 0 20px;padding: 2px;height: 1.1em;}

</style>

<asp:Button CssClass="hiddenBtn" ID="hdnSbt" runat="server" OnClick="hdnSbtClick" />

<table border="0" cellpadding="0" cellspacing="0" class="PageHeading">
<tr>

<td>
<h2><asp:Literal ID="litTitle" runat="server"></asp:Literal></h2>
<h3><asp:Literal ID="litSubTitle" runat="server"></asp:Literal></h3>

</td>
</tr>
</table>

<div style="float:left; margin-top:-30px; position:relative; top:30px; width:210px; " id="divDT">
<asp:TextBox ID="txtDateRange" runat="server" CssClass="dpicker"></asp:TextBox>
</div>

<div class="main">
<asp:Panel ID="pnlChart" runat="server">
<asp:Chart ID="Chart1" runat="server"
Width="640" Height="350" BorderlineColor="Transparent" BorderlineWidth="0" OnClick="Chart1_Click" OnCustomizeLegend="Chart1_CustomizeLegend">
<Legends>

<asp:Legend Name="Legend1" MaximumAutoSize="40" IsDockedInsideChartArea="false"
IsTextAutoFit="False" BackColor="Transparent" DockedToChartArea="ChartArea1"
Docking="Top" Alignment="Near" LegendStyle="Row">
<Position Width="100" Height="6" X="0" Y="10" Auto="false" />
</asp:Legend>
<asp:Legend IsDockedInsideChartArea="false" MaximumAutoSize="40" Name="lgdChartType" IsTextAutoFit="False" BackColor="Transparent" DockedToChartArea="ChartArea1" Docking="Top" Alignment="Far" LegendStyle="Row">
<Position Width="50" Height="10" X="70" Y="0" Auto="false" />
<CustomItems>
<asp:LegendItem Name="LegendText" >
<Cells>
<asp:LegendCell CellType="Text" Text="Graph By" ForeColor="#999999" Name="Cell1">
<Margins Top="20" Bottom="20" />
</asp:LegendCell>
</Cells>
</asp:LegendItem>
<asp:LegendItem Name="LegendDay" >
<Cells>
<asp:LegendCell CellType="Image" Image="~/images/network/Charts/1-US.png" ToolTip="Daily" Name="Cell1" PostBackValue="ChatType/0">
<Margins Left="0" Right="0" />
</asp:LegendCell>
</Cells>
</asp:LegendItem>
<asp:LegendItem Name="LegendWeek" >
<Cells>
<asp:LegendCell CellType="Image" ToolTip="Weekly" Image="~/images/network/Charts/2-DS.png"
Name="Cell1" ImageTransparentColor="Black" PostBackValue="ChatType/1">
<Margins Left="0" Right="0" />
</asp:LegendCell>
</Cells>
</asp:LegendItem>
<asp:LegendItem Name="LegendMonth" >
<Cells>
<asp:LegendCell CellType="Image" ToolTip="Monthly" Image="~/images/network/Charts/3-US.png" PostBackValue="ChatType/2"
Name="Cell1" ImageTransparentColor="Black">
<Margins Left="0" Right="0" />
</asp:LegendCell>
</Cells>
</asp:LegendItem>
</CustomItems>
</asp:Legend>
</Legends>
<Series>
<asp:Series BorderColor="#5693c9" BorderWidth="4" ChartType="Area"
Color="230, 242, 250" Legend="Legend1" MarkerBorderColor="White"
MarkerColor="#5693c9" MarkerSize="8" MarkerStyle="Circle" Name="Jobs"
XValueType="DateTime" LegendText="Jobs Posted" YAxisType="Secondary">
</asp:Series>

<asp:Series BorderColor="125,172,214" BorderWidth="4" ChartType="Area"
Color="230, 242, 250" Legend="Legend1" MarkerBorderColor="White"
MarkerColor="#5693c9" MarkerSize="8" MarkerStyle="Circle" Name="Seek"
XValueType="DateTime" LegendText="Seek" >
</asp:Series>

<asp:Series BorderColor="224, 155, 73" BorderWidth="4" ChartType="Area"
Color="225, 224, 89" Legend="Legend1" MarkerBorderColor="White"
MarkerColor="224, 155, 73" MarkerSize="8" MarkerStyle="Circle" Name="Site"
XValueType="DateTime" LegendText="Website" >
</asp:Series>
<asp:Series BorderColor="100, 100, 100" BorderWidth="4" ChartType="Area"
Color="200, 200, 200" Legend="Legend1" MarkerBorderColor="White"
MarkerColor="100, 100, 100" MarkerSize="8" MarkerStyle="Circle" Name="Autopeople"
XValueType="DateTime" LegendText="Autopeople">
</asp:Series>
<asp:Series BorderColor="#3AB54A" BorderWidth="4" ChartType="Area"
Color="188,255,150" Legend="Legend1" MarkerBorderColor="White"
MarkerColor="#3AB54A" MarkerSize="8" MarkerStyle="Circle" Name="Internal"
XValueType="DateTime" LegendText="Referral">
</asp:Series>

</Series>
<ChartAreas>

<asp:ChartArea Name="ChartArea1" BorderWidth="2" ><Position Width="100" Height="100" X="0" Y="20" Auto="false" />
<AxisY LineColor="238, 238, 238" LabelAutoFitStyle="None" Title="Applications">
<MajorGrid LineColor="238, 238, 238" LineDashStyle="Dash" />
<MajorTickMark Enabled="False" LineColor="LightGray" />
<LabelStyle Font="Arial, 11px, style=Bold" ForeColor="#444444" />
</AxisY>
<AxisX IsMarginVisible="false" LabelAutoFitStyle="DecreaseFont" IntervalAutoMode="VariableCount">
<MajorGrid LineColor="238, 238, 238" />
<LabelStyle Font="Arial, 11px, style=Bold" Format="dd MMM, yyyy" ForeColor="#444444"/>
</AxisX>
<%-- <AxisY2 Enabled="True" LineColor="238, 238, 238" LabelAutoFitStyle="None" Title="Jobs Posted">
<MajorGrid LineColor="238, 238, 238" LineDashStyle="Dash" />
<MajorTickMark Enabled="False" LineColor="LightGray" />
<LabelStyle Font="Arial, 11px, style=Bold" ForeColor="#444444" />
</AxisY2>--%>
<%-- <Position Height="94" Width="94" />
<Area3DStyle WallWidth="1" />--%>
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
</asp:Panel>

</div>
<script type="text/javascript">
//addLoadEvent(function() { FirejQuery(); });
Sys.Application.add_load(FirejQueryChart);
var run = false;
function FirejQueryChart() {
//hack
if ($('#divDT > div').length > 0) {
return;
}
$('#<%=txtDateRange.ClientID %>').daterangepicker({ arrows: true, dateFormat:'dd M yy',
onClose: function(dateText, inst) { $('#<%=hdnSbt.ClientID %>').click(); }
});

$('#lnkDTInit').click(function() {
$('#<%=txtDateRange.ClientID %>').focus();
$('#<%=txtDateRange.ClientID %>').click();

//$('#<%=txtDateRange.ClientID %>').datepicker('show');
$('#<%=txtDateRange.ClientID %>').daterangepicker('show');
});

$(".ui-daterangepicker-prev").click(function(event) { $('#<%=hdnSbt.ClientID %>').click(); });
$(".ui-daterangepicker-next").click(function(event) { $('#<%=hdnSbt.ClientID %>').click(); });
}


</script>
</ContentTemplate>
</asp:UpdatePanel>

Can someone point out whats wrong or should i put this in the IIS forum cause its happening only on a particular server


error: ajax XML http request

$
0
0

hello,

I have a calendar, if I click on any date the my context menu show successfully, but when I click on the list of context menu I call a ajax method for call services.

I try the same code without any different Its work fine, but in this new project it doesn't? I don't know what is that mean[object XMLHttpRequest]

this is my code on two project

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js" type="text/javascript"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"type="text/javascript"></script><script src="assets/js/jquery-ui.custom.min.js" type="text/javascript"></script><!-- ace scripts --><script src="assets/js/ace-elements.min.js" type="text/javascript"></script><script src="assets/js/ace.min.js"></script><!-- inline scripts related to this page --><script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script><script type="text/javascript">$(document).ready(function () {
                window.onclick = hideContextMenu;
                window.onkeydown = listenKeys;
            });

            var contextMenu = document.getElementById('contextMenu');
            var myUpdatePanel = '<%=upAttendance.ClientID %>';
            function listenKeys(event) {
                var keyCode = event.which || event.keyCode;
                if (keyCode == 27) {
                    hideContextMenu();
                }
            }

            function hideContextMenu() {
                contextMenu.style.display = 'none';
            }

            function showContextMenu(event, selectedDate) {
                contextMenu.style.display = 'block';
                contextMenu.style.left = event.clientX + 'px';
                contextMenu.style.top = event.clientY + 'px';$('#hdv_date').val(selectedDate);
                return false;
            }

            function absentClick() {
                $.ajax({
                    url: 'Attendance.asmx/Attendance_Insert',
                    data: "{'date':'" + $('#hdvDate').val() + "','type':'1','studentID':'" + $('#hdvStudentID').val() + "','createdBy':'" + $('#hdvCreatedBy').val() + "'}",
                    contentType: "application/json;charset=utf-8",
                    type: "post",
                    success: function () {
                        if (myUpdatePanel != null) {
                            __doPostBack(myUpdatePanel, '');
                        }
                    },
                    error: function (error) {
                        alert(error);
                    }
                });
                return false;
            }

//// Day Render

protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
        {
            string method = "return showContextMenu(event,'" + e.Day.Date.ToShortDateString() + "')";
            e.Cell.Attributes.Add("oncontextmenu", method);
        }

AjaxFileUpload customize language

$
0
0

Hi

I am using AjaxFileUpload on a Website which works great.
I would like to replace all english labels by german labels. I already tried this workaround:

http://stackoverflow.com/questions/24687983/changing-ajaxfileupload-controls-language/24688766#24688766

But it is not possible to replace all labels.
I know the translation for german is not made (found this file Resources_de.js ) so I set my webpage culture to french and tested with the french version. But while the wizard buttons changed to french the FileUpload labels stayed english.

I have no idea which files to put where to get languages other than english. Or do I have to create new dlls?
Is there somewhere a step by step manual how to put all that together and make it work?

Thanks for any help.

chris

Ajax ComboBox rendering ListItems correctly but not displaying

$
0
0

Here ddlSchool is the ajax Combo box

<code>
ddlSchool.DataSource = dt;
                             ddlSchool.DataTextField = "SchoolName";
                             ddlSchool.DataValueField = "Id";
                             ddlSchool.DataBind();
                             ddlSchool.Items.Insert(0, new System.Web.UI.WebControls.ListItem(" --Select-- ", "0"));
                             ddlSchool.SelectedValue = "0";</code>

when I inspect it renders the value but not displaying ,below code is only available during inspect

<code><ul id="ContentPlaceHolder1_ddlSchool_ddlSchool_OptionList"class="ajax__combobox_itemlist" style="visibility: hidden; z-index: 1000; overflow-x: hidden; overflow-y: auto; width: 416px; position: absolute; height: 425px; left: 293px; top: 1458px; display: none;">
<li>Maharishi Vidhyala</li>
<li>Little Kindom</li>
<li>Malaiar Manram</li>
<li>Sparkle dots</li>
<li>KTC nursery school</li>
</
ul></code>

Please help me to get the ListItems

ASP requiredfieldvalidator and Jquery

$
0
0

I have a problem, I have some jquery plugins running on my page (i.e. tabs). when i add asp requiredfieldvalidator the jquery function stops working, any ideas?

Why is a dynamically added ajax collapsible panel extender causing an error?

$
0
0

I have several aspx web pages in a project that generate content at run time and add controls dynamically. Everything works perfectly except for an addition I am trying to make in order to add an ajax collapsible panel extender dynamically also.  When I add the code to generate the extender to a dynamically generated row in a table that is static and already exists on the web page I get this:

[InvalidOperationException: An extender can't be in a different UpdatePanel than the control it extends.]
   System.Web.UI.ExtenderControl.RegisterWithScriptManager() +386
   AjaxControlToolkit.ExtenderControlBase.OnPreRender(EventArgs e) +67
   AjaxControlToolkit.ModalPopupExtender.OnPreRender(EventArgs e) +249
   System.Web.UI.Control.PreRenderRecursiveInternal() +162
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6925

Problem is there is not an update panel anywhere on the page and none are generated in the dynamically added controls so I am baffled why I am getting this error message. Following is the code that is causing the error. It dynamically generates the controls for the extender and adds the extender to an existing table as an new row .

                (create expander controls)
Dim NewRowExpander As New TableRow Dim NewCellExpander As New TableCell Dim MyLabelExpander As Label = New Label Dim MyLabelExpanderDisplay As Label = New Label Dim MyTableExpander As New Table Dim MyTableRowExpander As New TableRow Dim MyTableCellExpander1 As New TableCell Dim MyTableCellExpander2 As New TableCell Dim MyRowExpander As New TableRow Dim MyCellExpander As New TableCell Dim MyPanelExpander As Panel = New Panel Dim MyButtonExpander As ImageButton = New ImageButton Dim MyExpander As New AjaxControlToolkit.CollapsiblePanelExtender (create expander label)
MyLabelExpander.Width = New Unit("100%") MyLabelExpander.Height = New Unit("20px") MyLabelExpander.CssClass = "handpointer" MyLabelExpander.ClientIDMode = ClientIDMode.Static MyLabelExpander.ID = "ExpanderLabel" + RowCount.ToString.Trim (create expander button)
MyButtonExpander.Width = New Unit("10px") MyButtonExpander.Height = New Unit("10px") MyButtonExpander.ImageAlign = ImageAlign.AbsMiddle MyButtonExpander.ImageUrl = "/App_Pages/Handlers/Image.ashx?ID=DownArrow" MyButtonExpander.ClientIDMode = ClientIDMode.Static MyButtonExpander.ID = "TableExpanderButton" + RowCount.ToString (create display label for expander display panel)
MyLabelExpanderDisplay.Width = New Unit("100%") MyLabelExpanderDisplay.Height = New Unit("100%") MyLabelExpanderDisplay.ClientIDMode = ClientIDMode.Static MyLabelExpanderDisplay.ID = "ExpanderLabelDisplay" + RowCount.ToString.Trim (create expander table cell 1)
MyTableCellExpander1.VerticalAlign = VerticalAlign.Top MyTableCellExpander1.HorizontalAlign = HorizontalAlign.Center MyTableCellExpander1.Width = New Unit("100%") MyTableCellExpander1.Height = New Unit("20px") MyTableCellExpander1.Controls.Add(MyLabelExpander) MyTableCellExpander1.ClientIDMode = ClientIDMode.Static MyTableCellExpander1.ID = "TableCellExpanderDisplayTop" + RowCount.ToString MyTableCellExpander1.Controls.Add(MyLabelExpander) (create expander table cell 2)
MyTableCellExpander2.VerticalAlign = VerticalAlign.Top MyTableCellExpander2.HorizontalAlign = HorizontalAlign.Center MyTableCellExpander2.Width = New Unit("100%") MyTableCellExpander2.Height = New Unit("20px") MyTableCellExpander2.Controls.Add(MyButtonExpander) MyTableCellExpander2.ClientIDMode = ClientIDMode.Static MyTableCellExpander2.ID = "TableCellExpanderDisplayBottom" + RowCount.ToString MyTableCellExpander2.Controls.Add(MyButtonExpander) (create expander table row)
MyTableRowExpander.Width = New Unit("100%") MyTableRowExpander.VerticalAlign = VerticalAlign.Top MyTableRowExpander.Height = New Unit("20px") MyTableRowExpander.CssClass = "information" MyTableRowExpander.ClientIDMode = ClientIDMode.Static MyTableRowExpander.ID = "TableRowExpanderDisplay" + RowCount.ToString MyTableRowExpander.Controls.Add(MyTableCellExpander1) MyTableRowExpander.Controls.Add(MyTableCellExpander2) (create expander table)
MyTableExpander.BackColor = System.Drawing.Color.FromArgb(0, GridBackColor1, GridBackColor2, GridBackColor3) MyTableExpander.ForeColor = System.Drawing.Color.FromArgb(0, GridTextColor1, GridTextColor2, GridTextColor3) MyTableExpander.BorderStyle = BorderStyle.None MyTableExpander.Width = New Unit("100%") MyTableExpander.Height = New Unit("20px") MyTableExpander.CellPadding = 0 MyTableExpander.CellSpacing = 0 MyTableExpander.CssClass = "rounded" MyTableExpander.ClientIDMode = ClientIDMode.Static MyTableExpander.ID = "TableExpanderDisplay" + RowCount.ToString MyTableExpander.Controls.Add(MyTableRowExpander) (create expander display panel)
MyPanelExpander.BorderStyle = BorderStyle.None MyPanelExpander.BorderWidth = New Unit("0px") MyPanelExpander.ClientIDMode = UI.ClientIDMode.Static MyPanelExpander.Controls.Add(New LiteralControl("<br /><b>Article:</b><br /><br />")) MyPanelExpander.Controls.Add(MyLabelExpanderDisplay) MyPanelExpander.ClientIDMode = ClientIDMode.Static MyPanelExpander.ID = "ExpanderPanel" + RowCount.ToString.Trim MyPanelExpander.Controls.Add(MyLabelExpanderDisplay) (create expander and add controls)
MyExpander.Controls.Add(MyTableExpander) MyExpander.Controls.Add(MyPanelExpander) MyExpander.Collapsed = True MyExpander.CollapsedText = "<b>More ...</b>" MyExpander.ExpandedText = "<b>Less ...</b>" MyExpander.Enabled = True MyExpander.ScrollContents = "False" MyExpander.SuppressPostBack = "True" MyExpander.CollapsedSize = "1" MyExpander.TextLabelID = MyLabelExpander.ClientID MyExpander.ExpandControlID = MyButtonExpander.ClientID MyExpander.CollapseControlID = MyButtonExpander.ClientID MyExpander.ImageControlID = MyButtonExpander.ClientID MyExpander.TargetControlID = MyPanelExpander.ID MyExpander.ClientIDMode = ClientIDMode.Static MyExpander.ID = "ExpanderLabelDisplay" + RowCount.ToString.Trim (create expander container row)
NewRowExpander.BackColor = System.Drawing.Color.FromArgb(0, GridBackColor1, GridBackColor2, GridBackColor3) NewRowExpander.ForeColor = System.Drawing.Color.FromArgb(0, GridTextColor1, GridTextColor2, GridTextColor3) NewRowExpander.BorderColor = System.Drawing.Color.FromArgb(0, GridBorderColor1, GridBorderColor2, GridBorderColor3) NewRowExpander.Width = New Unit("100%") NewRowExpander.VerticalAlign = VerticalAlign.Top NewRowExpander.HorizontalAlign = HorizontalAlign.Center NewRowExpander.BorderWidth = 0 NewRowExpander.Visible = False NewRowExpander.ClientIDMode = ClientIDMode.Static NewRowExpander.ID = "TableRowExpand" + RowCount.ToString (create expander container cell)
NewCellExpander.Width = New Unit("100%") NewCellExpander.HorizontalAlign = HorizontalAlign.Center NewCellExpander.VerticalAlign = VerticalAlign.Top NewCellExpander.BorderColor = System.Drawing.Color.FromArgb(0, GridBorderColor1, GridBorderColor2, GridBorderColor3) NewCellExpander.BorderWidth = 0 NewCellExpander.Visible = True NewCellExpander.ClientIDMode = ClientIDMode.Static NewCellExpander.ID = "TableCellExpand" + RowCount.ToString + Chr(96 + CellCount) (add expander to container cell & row to static a table that exists on the page)
NewCellExpander.Controls.Add(MyExpander) NewRowExpander.Controls.Add(NewCellExpander) TableDisplayList.Rows.Add(NewRowExpander)

If anyone has any ideas why this code is not working when all the other dynamically generated controls on the page work fine I would greatly appreciate it ... I have looked over this code for days and still cannot see what is causing this error.

Thanks in advance to anyone who is obviously much smarter than me and can catch what is happening here!

David

Viewing all 5678 articles
Browse latest View live


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