Showing posts with label value. Show all posts
Showing posts with label value. Show all posts

Wednesday, March 28, 2012

Extending the AutoCompleteExtender

Hi,

I'm trying to extend the AutoCompleteExtender so that is also can return an extra (hidden) value. For now I just do this by passing the text and the value returned by the WebMethod just as a comma separated string, i.e. "AnObject;5" (where 5 is the ID of the object). I just started on this so I'm not sure of I'm doing things the way they are supposed too. So here's a question.

I managed to extend the AutoCompleteBehavior javascript so that I can pass the result of the WebMethod to the TextBox and it just shows the text (the value is split of).

I also added an extra property ValueTextBoxId to the Properties of the AutoCompleteExtender to reference the TextBox which should store the hidden value. I have now the correct ClientId of the TextBox in the javascript. Next step is setting the value of that textbox.

I can use $(this.get_valueTextBoxId()).value to set it. But I guess it's more in the ways of Atlas to use the Sys.Ui.TextBox object. Only I cannot find any documentation how I can use that object when I have just a ClientID.

Anybody an idea?

Not sure of the solution to your other issues, but to use the Sys.UI.TextBox with a client id you need only do this.

var AtlasTextBox = new Sys.UI.TextBox($(ClientID));
AtlasTextBox.initialize(); // I can't remember if this line is required or not.

Jay

Saturday, March 24, 2012

Exception / Error 500 on using UpdatePanel and postback of value starting with "less than"

We are using the December, 19, release of AJAX CTP (and Control Toolkit) and are noticing the following behaviour:

If you are putting for example a TextBox into an UpdatePanel, filling the box with a value like "<x" and do a postback of that value then you will receive the following error message:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occured while processing the request on the server. The status code returned from the server was: 500

If you use empty braces (<>) everything works fine, if you uses only the closing brace (>) there is also no problem.

Does anybody have more detailed information on this problem or how to avoid it?

Regards,
ReneMT

put validaterequest="false" in the <%@. %> at the top.

NOTE: when you do this you must provide your own validation, because leave it out might introduce security risks of scripts injecting attacks.


Hmmm...

That may be a solution - but I think basically this is no real good one (as you are already pointing out) [:-)]. I thought about something like HTML encoding for postback values... Any possibilities in this direction?

ReneMT


hello.
well, not out of the box. btw, this is not an ajax problem...if you build a simple asp.net page, you'llget the same results.

Arrrrrrgh...

If this is a fact it is really sadIndifferent So in my eyes the only workaround were

Forbid input of the "<" sign or

I'm posting this response at the root because it may be beneficial...

I tried all the methods discussed here, but then I ran across a different thread in which they were running into a problem with all 3 releases (AJAX 1.0, CTPs, Atlas) where physical file names did not match up with the file name in the URL. Of course this can happen anytime you do a postback and the associated Code Behind (CB) page flips you out to a different page without updating the URL in the browser.

So my fix didn't involve any fix at all. I just went to the actual page (instead of being flipped over there by my CB code) andw00t! everything is kosher. I also tried using symbols discussed here (my AJAX dll versions are 1.0) and I verified that ICANput symbols in text fields with no resulting errors.

Please let me know if this is confusing.


I have a related problem with the TImer control in Ajax. I inject a <br> tag into a READ-ONLY text box, but when the Timer refreshes the TextBox I get the same error. Seehttp://forums.asp.net/thread/1626704.aspx

Ivan


I'm suddenly having this problem with FireFox 2.0.0.3. If my editor/textarea contains only text, good, if it's HTML - no go. Tried the ValidateRequest="false" hack, it did kinda work, but I ended up with firefox sending the old values from the textarea!

Anyone else working on this?


Any updates or fix on this issue?

Everytime postback hiddenfield outside updatepanel

Hello,

I am using some updatepanels inside my site.

There is a hiddenfield value I want to get back on every callback of any updatepanel.
This field is not inside an updatepanel. How can I do this?

Thank you,

Christian

Hi,

what are you going to do with the hidden field's value? I ask you this because a binding may solve your problem.
Hi,

thank you for your reply,

it is a session-id and our own viewstate variable. (We are not using the MS implementation of sessions and we are storing the viewstate in the database).

Christian

Wednesday, March 21, 2012

Event/Value triggers from custom user controls

Hi, here is my problem:
I have a menu made up of asp:LinkButton(s), each one with some unique id
the menu itself is a usercontrol holding these LinkButtons in some form or another
Now, since i have many such buttons i don't want to add:
<trigger>
<atlas:ControlEventTrigger ControlID="Menu$someLinkButton" EventName="Click" />
</trigger
for each one of my LinkButtons but rather have something like:
<trigger>
<atlas:ControlEventTrigger ControlID="Menu" EventName="ItemClicked" />
</trigger>
(or use the value somehow)

to do this i need to add an event to my "Menu" and then i need to raise it somehow before postback
so only partial rendering will be done.

Can any1 help me as to how to set this up?

Tx in advance,
MeWHy dont you have a TreeView control inplace of the linkbuttons, so you can use the SelectedNodeChanged event of the TreeView?

Thanks
Well, for one thing, i need to write from right to left, and the i didn't find anywhere in the treeview support for this kind of thing.
Other than that, why not use my own? i just need to know how to setup the event and have the <atlas:updatecontrol> catch it when it triggers. i'm just not sure how to go about implementing this (altho i'm pretty sure it can't be that difficult), need someone to show me the ropes.

errow message in autocomplete exstention

Just install the toolkit getting this err

"AjaxControlToolkit.AutoCompleteExtender missing required ServiceMethod property value for AutoCompleteExtender1.
Parameter name: ServiceMethod"

What coud be the problem ??

You are missing the WebService that is used in the AutoCompleteExtender. The default AutoCompleteExtender takes GetCompletionList as service method in AutoComplete.asmx. Check you have that file

Thanks


i downlodede the exstention - zip file, where is the web servise ?


If you have downloaded only the extension, then you need to provide the WebSerivce methods.

If you have download the AjaxToolkit, then the web service comes along with that. The source for toolkit is herehttp://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=AtlasControlToolkit

Thanks


DEar Frind

I download it from the same place , install the template created my tab at vs 2005 adn chose the dll from the bin file at the websample ?

What more need i do ?


Post the code you have written for the autocomplete extender

Thanks


hey

The code of the autocomplete

<cc1:AutoCompleteExtenderID="AutoCompleteExtender1"runat="server"TargetControlID="TextBox1"></cc1:AutoCompleteExtender>

- getting exception in the begining of the page loading.

Thank u


If that is your code, then its correct you are getting the error. AutoCompleteExtender needs servicepath and service method from where it can pick the values for the list. Did you see the sample at http://ajax.asp.net/ajaxtoolkit/AutoComplete/AutoComplete.aspx and how it was implemented? Check the autocomplete properties in the link given, and if you open the AutoComplete folder in the SampleWebSite you downloaded, you will see the complete code on how it was implemented.

Thanks


Saw it Ofcourse but canot find the asmx file ?

copy the servise path as wriiten, getting err that canot find the asmx file.


Thnak its works - wrote the hole path.

ScriptPath

="AutoComplete.asmx"TargetControlID="TextBox1"CompletionInterval="12"ServiceMethod="GetCompletionList"

working - thank uBig Smile


If you have downloaded the AjaxControlToolkit properly the asmx file is in

AjaxControlToolkit\SampleWebSite\AutoComplete\AutoComplete.asmx and the corresponding .cs file in the App_Code.

Thanks