Showing posts with label user. Show all posts
Showing posts with label user. Show all posts

Wednesday, March 28, 2012

Why ScriptManager in MasterPage is not enough to the toolkitExtender control?

This is the error I get when look on a page and drop the User control that include the ajaxTooltip from any type.

Any suggestion?

The Error

Do you use ScriptMangerProxy?you need to use ScriptManager/ ScriptManagerProxy both for master page.

Where to add the ScriptManager and where to add the ScriptManagerProxy to get a clear design time project developing?

To explain the controls, pages, masters I have, here are they:

1. A master page that include a ScriptManager (I try to include a ScriptManagerProxy also).

2. A page that inherit the MasterPage and have a User Control in it by design time(drag and drop).

3. A User Control that have a modalPopupExtender in it, that work properly.

My only problem that other developers use my User Control in them Pages and the User Control(that added to the page) raise a:

Error Rendering Control

An unhandled exception has occurred.

The control with ID 'MpdalPopupExtender1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.

What can I add to the Page, Master or may be web.config?

Monday, March 26, 2012

window.debug.isDebug is null or not an object

I have user control which contains UpdatePanel. For UpdatePanel I have tried to put UpdatePanelAnimationExtender, but there's coming javascipt error which says "window.debug.isDebug is null or not an object". Without UpdatePanelAnimationExtender UpdatePanel is working great. I'm using ASP.NET 2.0 and latest AJAX Framework and ControlToolkit. What could be wrong?

Thanks
juster

You likely have old scripts from an AJAX CTP or Beta cached on your web server or on your browser. Reset IIS and make sure you do a CTRL-F5 on your browser.

Saturday, March 24, 2012

Without installing Atlas, its not working in IE

I am developing Website Application using VS 2005 and Atlas June CTP. In the application, one page contains user control which has two Dropdown lists. Depending upon the value of first dropdown list, using Atlas, second list will get populated. I have added UpdatePanel control in user control (ascx page) for second list and Script manager in aspx page. I have added reference of Atlas.dll and modified Web.config also. This is working in IE and FireFox.
If I uninstall Atlas and run the application, it's not working in IE. To make it work in FireFox, I need to include "Scriptlibrary" folder into solution. But in IE, "SelectedIndexChanged" event is not getting triggered.
The application is working fine for both the browsers on machine where Atlas is installed. Which other assemblies are required to run Atlas on the machine where Atlas is not installed?

Thanks in advance,
Milind

hello.

well, if you're not using the atlas toolkit, then you only need the atlas dll.


Hello,
I am not using Atlas toolkit. Atlas.dll is already present in the "Reference" but still it's not working. Everything is working fine on developer's machine where Atlas is installed.

Thanks,
Milind

hello again.

the only thing that occurs to me is if the web site is not configred as a web app or is not using asp.net 2.0...

Wizard+updatepanel+usercontrols

I've got a problem using updatepanels inside the wizard.

Each of the wizard steps is a user control in my case, so I load the user controls into the steps. If two of my usercontrols contain updatepanels then I get "Microsoft JScript runtime error: Object required"

somewhere in the Atlas JavaScript code when using the Atlas functionality in the steps:

function destroyTree(element, markupContext) {

if (element.nodeType == 1) { //error on this line

if (element.control) {

markupContext.removeObject(element.control);

element.control.dispose();

}

var children = element.children;

for (var i = children.length - 1; i >= 0; i--) {

var node = children[i];

destroyTree(node, markupContext);

element.removeChild(node);

}

}

}

I've tried moving the scriptmanager wherever it is possible: in the page containing the wizard, in the user controls. It won't happen if I have only one usercontrol/wizard step using updatepanels. So if anyone encountered similar problems or have ideas how to make it work-reply.

have you tried setting Mode="Conditional" on all of your updatepanels?

http://forums.asp.net/thread/1268686.aspx

Thanks, that worked!

I've tried setting the mode to conditional on all updatepanels for sure, but probably missed one updatepanel that was set to always or something like that.Smile [:)]

WMP-Like Search Function

Hey all,

Basically, I want to create a search function like WMP has; i.e. a search function of which the results are updated every time the user enters a new character in the searchbox.

How should I go about this? I've got it like this now:

I've got an UpdatePanel that contains a DataGrid, set up to do the query to my database. I added an update trigger for the TextChanged event of my asp:TextBox.
This works, but the results are updated only when I hit enter/return in the textbox. Is there a way to make the UpdatePanel update when a key is pressed in my TextBox?

Maybe I have to handle this client side, like handling an added onkeypress event.. But then I still don't know exactly how to call this UpdatePanel.Update(); method.
Or does another/better way to implement such a search function exist?

Any help would be greatly appreciated!

Jorn

Did you ever get this figured out as I would like to know too...

working AJAX with a paging user control

Hi,

I am currently working with embedding AJAX into a previously developed website, and until now have had no issues, what i am trying to do i am not sure is possible, let me explain...

I have a simple web form which contains a repeater, and a user control (which is used for paging "ucPaging"), this user control has a dropdownlist embedded in it. I want the drop down list to fire an AsyncPostBackTrigger to the upnlPlayers update panel, and the repeater to use the SelectedValue of the dropdownlist in the paging user control.


I have tried to create a new AsyncPostBackTrigger in the code behind of the main aspx page, but at runtime, it says that the dropdownlist does not exist. Is what i am trying to do possible? I really don't want to have to resort to using the ASP paging control that is provided, as i am potentially returning hundreds of thousands of records.

Provided is the code in the main Players.aspx page...


<controls:Paging ID="ucPaging" runat="server" />
<ajax:UpdatePanel ID="upnlPlayers" runat="server">
<ContentTemplate>
<asp:Repeater ID="repPlayers" runat="server" OnItemDataBound="repPlayers_OnItemDataBound"....... etc etc etc you know the deal

</ContentTemplate>
<Triggers>
<ajax:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
</Triggers>
</ajax:UpdatePanel>

And the user control code...

<div id="Paging">
<div class="Previous"><asp:HyperLink ID="hlPrevious" runat="server" /></div>
<div class="Page"><asp:Label ID="lblViewingRecords" runat="server" /> <asp:DropDownList ID="ddlRecords" runat="server" OnSelectedIndexChanged="ddlRecords_OnSelectedIndexChanged" AutoPostBack="true" /></div>
<div class="Next"><asp:HyperLink ID="hlNext" runat="server" /></div>
</div>

Thanks for your help!

e

Since the DropdownList is in User Control, You have to add it as programmatically rather than declaratively. For Example in the Page load event add the following codes:


if (!IsPostBack)
{
AsyncPostBackTrigger tr = new AsyncPostBackTrigger();

tr.ControlID = YourDropDownList.ClientID;
tr.EventName = "SelectedIndexChanged";
YourUpdatePanel.Triggers.Add(tr);
}

Would this be practical?

I was thinking it might be nice to have a search user screen which in the background uses a webservice to call out and retrieve a list of users from the db and use the autocomplete method I have seen used before - I'm not worried about security its just would this by using atlas to do this would this be a reasonable thing to do?

hello.

well, you could do that if you have a web service that returns that info...

Wednesday, March 21, 2012

Writing Ajax Rating to DB

Hi

Well Heres what I want to happen


1. User rates page via rating control, selecting 1- 5

2. 1,2,3,4,5 get stored in a DB

3. The top five pages with the most votes (highest number), a link gets displayed to the web page on the home page

http://www.codeproject.com do something almost identical to this, but the one thing I dont understand is that the website will have around 1k of pages, therefore wont this be really slow?

Thanks

If the database tables are indexed properly then a few thousand records in a table will run very quickly.

In your other post on this (http://forums.asp.net/t/1128872.aspx) I included a script you could run on SQLExpress, this should run find with 1k of pages and 5-10k of ratings.


Thanks for that, I havent got that far yet, as I am having some trouble intergrating ajax into an existing asp.net app. That script looks great though!


Richard Line,

Well done.Big Smile

XLST and control toolkit

I have been learning about using an XML file and an XLST file to create a user editable form however I have yet to find a successful working version of this including a toolkit procedure

Can it be done? If so has anyone actually done it and showed how? If not why not?

A not correctly formatted example of what I want to do:

<XML File>

<Input Name="NumbersOnly" FilteredTextBox="Yes" Type="NumbersWithNeg"/>

</XML>

gets me the output of this:

<

asp:TextBoxID="TextBox3"runat="server"></asp:TextBox>

<

ajaxToolkit:FilteredTextBoxExtenderID="ftbe"runat="server"TargetControlID="TextBox3"FilterType="Custom, Numbers"ValidChars="-"/>

It can be done. Heres how

<Code on main page>

private

void CreateSurvey() {// Load the data sourceXPathDocument surveyDoc =newXPathDocument(Server.MapPath("ExSurvey.xml"));// Load the xslt to do the transformationsXslTransform transform =newXslTransform();

transform.Load(Server.MapPath(

"MakeControls.xslt"));// Get the transformed resultStringWriter sw =newStringWriter();

transform.Transform(surveyDoc,

null, sw);string result = sw.ToString();// remove the namespace attribute

result = result.Replace(

"xmlns:asp=\"remove\"","");

result = result.Replace(

"xmlns:cc1=\"remove\"","");

result =

"<%@. Register Assembly=\"AjaxControlToolkit\" Namespace=\"AjaxControlToolkit\" TagPrefix=\"cc1\" %>" + result;int i;// parse the control(s) and add it to the pageControl ctrl = Page.ParseControl(result);

survey.Controls.Add(ctrl);

}

<XLST File>

<

xsl:stylesheetversion="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns:asp="remove"xmlns:cc1="remove">

<

xsl:outputmethod="xml"indent="yes"encoding="utf-8"omit-xml-declaration="yes"/>

<

xsl:templatematch="/">

<

table>

<

xsl:for-eachselect="//question">

<

tr>

<

tdvalign="top"><xsl:value-ofselect="@.name" />

<

xsl:iftest="@.required = 'yes'">

<

asp:RequiredFieldValidatorErrorMessage=" Required Field"runat="server"ControlToValidate="{@.name}" />

</

xsl:if>

</

td>

<

td>

<

xsl:iftest="@.type='text'">

<

asp:TextBoxid="{@.name}"runat="server" />

<

cc1:FilteredTextBoxExtenderID="FilteredTextBoxExtender{@.name}"runat="server"TargetControlID="{@.name}"FilterType="Numbers">

</

cc1:FilteredTextBoxExtender>

</

xsl:if>

<

xsl:iftest="@.type='radio'">

<

asp:RadioButtonListid="{@.name}"runat="server">

<

xsl:for-eachselect="choice">

<

asp:ListItemValue="{@.value}"><xsl:value-ofselect="@.value" /></asp:ListItem>

</

xsl:for-each>

</

asp:RadioButtonList>

</

xsl:if>

</

td></tr>

</

xsl:for-each>

</

table>

<

asp:buttonid="submit"runat="server"Text="Submit" />

</

xsl:template>

</

xsl:stylesheet>

XMLHTTP and Digest Authentication

Hi, I'm having some problems with XMLHTTP.open and digest authentication.


I am embedding the user name and password into the XMLHTTP.open function (method, file, async, "UserName", "Password"). The server is Apache. Basically, when I switch to Basic authentication, the script works fine. However, it does not work correctly when I switch authentication to Digest. HTTP status returns an odd number, (5 digits). And it looks like the callback function is never executed.

Anyone have any insights on this?

Hi,

It seems that the target page might have some errors.

Need more help on XML Http post, below link might help you..

http://www.devx.com/DevX/Tip/17500

Happy Coding

Please mark as "Answer" if you find this post helpful


1) The target page just spits out text. There's no scripting of any kind on the target page. The only sort of server action is .htaccess for authentication.

2) I'm not using POST. I'm using GET. However, that's irrelevant. The error exists either way.


Hi,

It's clear to us in helping if you post all your javascript and target page code.