Showing posts with label view. Show all posts
Showing posts with label view. Show all posts

Wednesday, March 28, 2012

Did I miss something during installation of AJAX 1.0v?

Hi everyone;

I'm using VS2005 and I've just installed AJAX and it works but in the source view it underlines Script Manager, UpdatePanel, contenttemplate and controls under contenttemplate. I guess I missed something that I don't know:) My simple page code is belove:

Thanks... Kaan ?ZGEN

<%

@dotnet.itags.org.PageLanguage="VB"MasterPageFile="~/Copy of Turuncu.master"AutoEventWireup="false"CodeFile="DNM2.aspx.vb"Inherits="DNM2"title="Untitled Page" %>

<%

@dotnet.itags.org.RegisterSrc="Menu.ascx"TagName="Menu"TagPrefix="uc1" %>

<

asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server"><asp:ScriptManagerid="ScriptManager1"runat="server"/>

<asp:UpdatePanelid="UpdatePanel1"runat="server"UpdateMode="Conditional"><contenttemplate><asp:Labelid="Label1"runat="server"Text="Label"></asp:Label><asp:Buttonid="Button1"runat="server"Text="Button"></asp:Button></contenttemplate></asp:UpdatePanel> <asp:LabelID="Label2"runat="server"Text="Label"></asp:Label><asp:LoginID="Login1"runat="server"></asp:Login><uc1:MenuID="Menu1"runat="server"/>

</

asp:Content>Have you installed SP1 for VS 2005? That can happen if you haven't.

Is there such service pack?? Thanks I didn't know it... :) I'll try and let you know if solved..

Kaan ?ZGEN


Hi mdenn;

Yes that was the problem; now because of you (sayende) I got SP1 and my problem is solved

Thanks..

Kaan ?ZGEN

Monday, March 26, 2012

developing composite control that combines Ajax controls

Hi,

Is it possible to write a composite control that consists of UpdatePanels, and other control from Ajax Control Toolkit?

I would be happy to view some examples on developing this kind of control.

Thanks

Hello,

You can do this. It is possible.

I suggest that you use a scriptmanagerproxy in your control in case the page containing the control has a scriptmanager already. Aslo, you may have an easier time using the update panel in the containing page instead of in the control to get the ajax capabilities.

Good Luck,

Louis


Hi,

Thanks for the reply, do you suggest to put the composit control inside an update panel?

Im planning to build two build two composite controls:

one of them should contain an AutoCompleteExtender and other simple web controls . so I guess there wont be any problem with it.

but the other control will contain a TabContainer (from the Ajax Control Toolkit) I thought to put on each tab panel's content template an update panel (to reduce the amont of rerendered data, and save bandwith)

do you think that in this case its better to locate the whole TabContainer inside one UpdatePanel?

Thanks,

Tal


Yes, I suggest not including the update panel in the usercontrol.


Hi,

Im writting a composite control as I described in my first post (combines AutoCompleteExtender and FilteredTextBoxExtender and a TextBox)

I wrote the following Render function :

1 SearchAutoComplete =new AutoCompleteExtender();2 SearchAutoComplete.ID ="SearchAutoComplete";3 SearchAutoComplete.MinimumPrefixLength = 3;4 SearchAutoComplete.BehaviorID ="AutoCompleteBehavior";5 SearchAutoComplete.EnableCaching =true;6 SearchAutoComplete.CompletionSetCount = 5;7 SearchAutoComplete.UseContextKey =true;8 SearchAutoComplete.ServiceMethod ="GetCompletionList";9 SearchAutoComplete.TargetControlID ="SearchTextBox";10//SearchAutoComplete.OnClientItemSelected = "";1112 SearchFilteredTextBox =new FilteredTextBoxExtender();13 SearchFilteredTextBox.ID ="SearchFilteredTextBox";14 SearchFilteredTextBox.TargetControlID ="SearchTextBox";15 SearchFilteredTextBox.BehaviorID ="FilteredTextBoxBehavior";16 SearchFilteredTextBox.FilterType = AjaxControlToolkit.FilterTypes.Custom | FilterTypes.Numbers;1718 SearchByNameLabel =new Label();19 SearchByNameLabel.ID ="SearchByNameLabel";20 SearchByNameLabel.Text = Resources.Resource.SearchByName;2122 SearchByNumberLabel =new Label();23 SearchByNumberLabel.ID ="SearchByNumberLabel";24 SearchByNumberLabel.Text = Resources.Resource.SearchByNumber;2526 SearchTextBox =new TextBox();27 SearchTextBox.ID ="SearchTextBox";2829this.Controls.Add(SearchAutoComplete);30this.Controls.Add(SearchFilteredTextBox);31this.Controls.Add(SearchByNameLabel);32this.Controls.Add(SearchByNumberLabel);33this.Controls.Add(SearchTextBox);
1 AddAttributesToRender(writer);23 writer.AddAttribute(4 HtmlTextWriterAttribute.Cellpadding,5"1",false);6 writer.RenderBeginTag(HtmlTextWriterTag.Table);7 writer.RenderBeginTag(HtmlTextWriterTag.Tr);8 writer.RenderBeginTag(HtmlTextWriterTag.Td);9 SearchByNameLabel.RenderControl(writer);10 writer.RenderEndTag();11 writer.RenderBeginTag(HtmlTextWriterTag.Td);12 SearchByNumberLabel.RenderControl(writer);13 writer.RenderEndTag();14 writer.RenderBeginTag(HtmlTextWriterTag.Td);15 SearchAutoComplete.RenderControl(writer);16 writer.RenderEndTag();17 writer.RenderBeginTag(HtmlTextWriterTag.Td);18 SearchFilteredTextBox.RenderControl(writer);19 writer.RenderEndTag();20 writer.RenderEndTag();21 writer.RenderEndTag();22

and got the following Exception:

"Error: Sys.ArgumentException: value must not be null for controls and behaviors.

parameter name:element"

Any idea?

Thanks


hi,

change

SearchAutoComplete.TargetControlID ="SearchTextBox"

to be

SearchAutoComplete.TargetControlID = SearchTextBox.ClientID

the script is hassling you about being unable to find the targetControl


Hi,

Thanks for your reply.

I want my WebMethod to be integrated with the CompositeControl (Im not intersted in Exposing it as a top level property).

How can I embed a web-service with the control (I prefer using PageMethod fo GetCompletionList). ?

I read somewhere that I should write a custom HttpHandler ( if i want my CompositeControl to use my embedded webservice) , It seems complicated , do you have en example for this?

or better , a solution for how I can use an "embedded" PageMethod?

Thanks,

Tal


Hi Tal,

It's not recommended to embed the pageMethod inside a UserControl.

By default, a client can't request for a user control( with extension .ascx) directly, it's blocked by the a special handler that prevents accessing. It's not recommend to change this behavior.

May be you are trying to implement a user control that is easy to maintain and use, but if the user has to pay more to get accustom to this.


Hi,

Im Writting a CompositeControl not a UserControl.

so actually Im trying to "embed" the PageMethod or Web-service method (GetCompletionList method) inside the DLL of my CompositeControl.

Is there a way to solve this?

(im not interesting in exposing the AutoCompleteExtender's ServiceMethod property)

I want that the logic of geting the completion results will be a part of my CompositeControl.

Thanks


It's also not allowed to access a assembly on client side directly.

There should always an endpoint( a class implement IHttpHandler interface ) on the server be responsible for processing a request. You may implement a class and use it to invoke the method in the dll.


Hi,

Do you have any refferences for how to implement such a class?

I have know idea how to write an HttpHandler that invokes a web-service that is embedded in a DLL...

Thanks


Hi,

Just create a class that implementIHttpHandlerinterface. And you may refer to the ScriptResourceHandler class in thesource code of ajax extension for a practical implementation of it.


Hi,

Thanks for the reply. I will have a look at the source code of ajax extension.

Do you think I should also implement an HttpHandlerFactory?

As I understand my custom HttpHandlerFactory will check all *.asmx requests,

if the asmx request is for my AutoComplete web service return my custom HttpHandler, otherwise return the default one.

is this correct?


Not necessary, you may register the Handler to a specific file name in web.config.

But if you plan to use .asmx, why don't you add a web service directly. It's a implicit httpHandler.


Hi,

what do you mean by "adding the web-service directly"?

Details of: ASP.NET AJAX January Futures CTP?

Hi!

In Details Page ofASP.NET AJAX January Futures CTP, haven't details about the "features". Where I can view this details?

saludos,

Reflector is your friend in situations like this (http://www.aisto.com/roeder/dotnet/)

Opening up Microsoft.Web.Preview in it, there's lots of WebPart stuff, a Timer control, ProfileService, Xml-Scripting


I am also wondering what are the "extended" funtionalities of Futures January CTP. Before I install it on my computer I would like to know what it extends. Has anyone tried it yet?

Design view problem w/Atlas and Visual Studio 2005

New to Atlas:Downloaded Atlas July CTP version and Atlas tools w/Visual Studio 2005 on Server 2003 os. I created a new project and .aspx webpage w/Grid1.master. I am unable to get design view to display without a gray screen appearing, so that I can put server controls in then select my data source. How do I get "design view" to appear without the gray screen?I have this code in my webpage:Help is greatly appreciated.

Open the master page in design mode - NOT your page...( I am assuming that you want to put the datasource controls in the master so all pages have access to them)

Ralph

Wednesday, March 21, 2012

Default Calendar view set at decades

Hi,

I'm using the Calendar control for a Date Of Birth field on my form. However I would prefer the calendar to open up on the decades screen so that members will be able to tell easily what they have to do. I have a feeling that if the calendar pops up displaying October 2007 for example, the users won't realise they can click on the title to go up a level. Whereas if they start on 2000-2009 its more easier to understand.

Thanks,

Curt.

Sorry to bump this thread, but does anyone know how to do this?


Hi CurtWRC,

My understanding of your issue is that you want to make the CalendarExtender to shown as "Year Mode" instead of "Day Mode". If I have misunderstood, please feel free to let me know.

Here is the sample which I switch the display mode on its OnClientShown event.

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"></script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1" Format="yyyy-MM-dd"OnClientShown="onCalendarShown"> </ajaxToolkit:CalendarExtender> <script type="text/javascript" language="javascript"> function onCalendarShown(sender,args){ sender._switchMode("years", true); } </script> </form></body></html>
Best regards,
Jonathan

Thatsexactly what I was after. Thanks Jonathan!