Showing posts with label create. Show all posts
Showing posts with label create. Show all posts

Wednesday, March 28, 2012

why now i cant use the namespace Sys.Data

How i can create a datatable in javascript to pass to a webmethod now if the namespace Sys.Data is removed?

Thanks

Just add the Preview version.

why page load is called when an updatepanel is updated

Hi,

i have just observed that when a request is posted to server inside an updatepanel. then load method of page is called.

create a page with script manager and updatepanel. put a button inside the panel. add a msgbox in the load eventhandler of page.

now when u will click the button page load eventhandler would be executed. i was expecting that only the load event of update panel would be executed not the page one. because what ajax says is that whole page is not reloaded only the updatepanel is reloaded. does it mean that the ajax only helps to not activate the back button on browser but underlying it reloads the page in fact.

thanks

Hi i think you misunderstood something. what AJAX meant for is not exactly for asynchronous postbacks. This means that you cant execute two threads parallelly. But what it does is partial rendering. During an async postback all the usual events will be executed but only the contents inside the Update panel will be rendered.


hello.

well, what they're trying to say is that only the updatepanel contents will be updated during a partial postback. you can use the scriptmanager isinasyncpostback property to see if you're in a partial postback scenario:

http://asp.net/AJAX/Documentation/Live/mref/P_System_Web_UI_ScriptManager_IsInAsyncPostBack.aspx


rex_alias:

Hi i think you misunderstood something. what AJAX meant for is not exactly for asynchronous postbacks. This means that you cant execute two threads parallelly. But what it does is partial rendering. During an async postback all the usual events will be executed but only the contents inside the Update panel will be rendered.

I'm pretty sure that's exactly what AJAX is meant for.

And you can execute two threads parallelly.

Partial rendering isn't related to AJAX, you can have partial rendering without AJAX, and you can have AJAX without partial rendering, although it's implemented in the UpdatePanel and its implementation uses AJAX.

And yes, the whole life cycle of the page happens on the server, but only the relevant portions of the output are rendered into a xml based diff-gram, and sent to the client.


This is the nature of Update Panel. You can filter out the Regular Post Back with an Async by Checking the Page ScriptManager.IsInAsyncPostBack. Or if you do not want to page to be called then use the Client Centric Development Model which is calling the Web Service or Static Page Methods.

Why there is no *.aspx.designer.vb files in Visual studio 2005?

On my computer windows XP, I use visual studio 2005 for development. I create a atlas project for my work.

Everytime when I create a new aspx or ascx file, there is no *.aspx.designer.vb file. But on some other computers(same environment), when create a new webform, VS will gerenate 3 files:

*.aspx, *.aspx.vb., *.aspx.designer.vb

Why? any settings related to this issue?

Hi,

the *.aspx.vb will not generate if you unselect checkbox "Place code in separate file" when you create a web form.

hope can help you.


Thanks for you reply. I knew that.

But I am not taliking about *.aspx.vb, I am talking about *.aspx.designer.vb

This *.aspx.designer.vb will hold all control variables declared in page *.aspx


Hi,

The computer where you can see the aspx.designer.vb file has the addin "Visual Studio 2005 Web Application Projects" available athttp://msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspx. Be aware that by installing the addin you do loose some feature at the moment like "profile", there is a work around available also, check the code project to get the addon.

Hope this helps you.

PS: I hope that microsoft changes there mind on the designer files, i love partial classes but i do not like loosing view of the main class.

VBS1


Thanks.

So if aspx.designer.vb is invisible on my computer under a wep application inside a solution, anyway can find out this aspx.designer.vb file for webform?

Why this doesnt work :(

Hi

I'm trying to create an calendarextender programmatically but it doesn't work :(

here is the code:

scriptManager =newScriptManager();

dateTimeMaskedTextBox =newTextBox();

dateTimeMaskedTextBox.ID ="DateTimer";

dateTimePicker =newImage();dateTimePicker.ID ="dateTimePicker";

dateTimePicker.ImageUrl =@dotnet.itags.org."~/icons/Calendar_scheduleHS.png";

calendar =newCalendarExtender();

calendar.TargetControlID ="DateTimer";

calendar.FirstDayOfWeek =FirstDayOfWeek.Monday;calendar.Format ="dd/MM/yyyy";

calendar.PopupButtonID = dateTimePicker.ID;

what's wrong with this???????

thanks.

you never actually add the control to the form. creating them in the code doesnt mean they are on the form. To add a control to a form programatically you do something like this.

Form1.Controls.Add(calendar);

so make sure you add your script manager, datetimepicker, datetimemasked box and calendar to the form you want it in


hmmmmmmmmSurprise

thanks a lot

I thought that calendar (CalendarExtender) it's not neccessary to be added on the form.

thanks in advance.

Why were the UpdatePanel-compatibile validators removed

Why were the UpdatePanel-compatible validators removed from the RTM build? This seems like it is going to create a lot of headaches!

The plan appear to be to an update of System.Web from windows update.

http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx

Monday, March 26, 2012

Will there be Visual Studio .NET 2005 Controls in the Toolbox?

Does anyone know if there are any plans to create drag and drop Atlas controls for the toolbox?All of the current Atlas server controls can be added using drag/drop and you can use the Visual Studio properties window to configure the components.

If the Atlas controls don't show up on your Toolbox, you can add them by dragging the Microsoft.Web.Atlas.dll from the Windows file manager to the toolbox or manually:

Right-click on Toolbox.

window.open (javascript function) + atlas

Hi everyone,

I'd like to know how create a simple function under Atlas (I used one before Atlas and it's works very well), like that one:

Sub wOpen(ByVal fWindow As String, ByVal fNameWin As String, ByVal fWidth As Integer, ByVal fHeight As Integer, ByVal fMenu As Boolean, ByVal fResizable As Boolean, ByVal fScroll As Boolean)
Dim strJ As String = "<script language='javascript'>"
strJ &= "window.open('" & fWindow & "', '" & fNameWin & "', "
strJ &= "'width=" & fWidth & ", height=" & fHeight & ", menubar="
If fMenu = True Then
strJ &= "yes"
Else
strJ &= "no"
End If
strJ &= ", resizable="
If fResizable = True Then
strJ &= "yes"
Else
strJ &= "no"
End If
strJ &= ", scrollbars="
If fScroll = True Then
strJ &= "yes"
Else
strJ &= "no"
End If
strJ &= "')<"
strJ &= "/script>"
Page.RegisterClientScriptBlock("wOpen", strJ)
End Sub


But under Atlas when a call it doesn't work:
wOpen(wOpen("http:..", "myWindow", 810, 620, True, True, True)

I really seach about, but I can't find anything about it.

So, if someone can help I really be thanks.

José SP/Brazil

It's me back again, and I've the answer, I just need remove the javascript tag from the code, like that:

Sub wOpen(ByVal fWindowAsString,ByVal fNameWinAsString,ByVal fWidthAsInteger,ByVal fHeightAsInteger,ByVal fMenuAsBoolean,ByVal fResizableAsBoolean,ByVal fScrollAsBoolean)Dim strJAsString

strJ =

"window.open('" & fWindow &"', '" & fNameWin &"', "

strJ &=

"'width=" & fWidth &", height=" & fHeight &", menubar="If fMenu =TrueThen

strJ &=

"yes"Else

strJ &=

"no"EndIf

strJ &=

", resizable="If fResizable =TrueThen

strJ &=

"yes"Else

strJ &=

"no"EndIf

strJ &=

", scrollbars="If fScroll =TrueThen

strJ &=

"yes"Else

strJ &=

"no"EndIf

strJ &=

"')"Me.ClientScript.RegisterStartupScript(Me.GetType(),"wOpen", strJ,True)EndSub

Windows XP-Like Folder Browser

Hi I'm not sure whether I'm posting to the correct place. I am trying to create a page that allows users to create a page to my website. This page contains a "Store" button, which when clicked calls a popup window (using ModalPopupExtender), which will then prompt the user where the page is to be stored. I was thinking of making this popup look similar to a "Save File As..." dialog box in Windows. My problem is I have no idea what controls to choose or how to even start on this popup. I am fairly new to asp.net and ajax and would like to hear your feedbacks/suggestions. Thanks.Hello gulrnpink,

why not to use the standard one? Just prepare the file to store and use the
following code for this

Response.Clear
Response.AddHeader("Content-Disposition", "attachment; filename=" + targetFile.Name)

Response.AddHeader("Content-Length", targetFile.Length.ToString)
Response.ContentType = "application/"
Response.WriteFile(targetFile.FullName)

g> Hi I'm not sure whether I'm posting to the correct place. I am
g> trying to create a page that allows users to create a page to my
g> website. This page contains a "Store" button, which when clicked
g> calls a popup window (using ModalPopupExtender), which will then
g> prompt the user where the page is to be stored. I was thinking of
g> making this popup look similar to a "Save File As..." dialog box in
g> Windows. My problem is I have no idea what controls to choose or how
g> to even start on this popup. I am fairly new to asp.net and ajax and
g> would like to hear your feedbacks/suggestions. Thanks.
g>
The page will actually be stored in a table called directory, which will then be called by another page using a treeview structure. This "Folder Browser" control will be populated using the data in my directory table. The control will not be displaying the folder structure within their Windows OS. Any suggestion? Thanks.

I think you can use Membership class which is built in .NET 2.0

There you can create profile per user and about storing page you have to create folder in web root

Store the pages under that folder


Actually, before users can access my website, they are prompted to enter their logon credentials. When the logon info entered has a match in my user table, the user is then granted access to my website. Things displayed inside the website will vary depending on the user's rights.

The thing I am looking for is how I can create a folder browser much like a Windows XP's "Save File As..." dialog. In this dialog box, I am planning to have a "Path" area where in the parent folder (first level) is displayed on the top maybe using a dropdownlist by default with a box underneath containing all the subfolders at the second folder. If such subfolder contains subfolders (third level), then double-clicking on that particular folder will cause its subfolders to be displayed and replacing the "Path" area to display the parent folder of the subfolders currently being displayed. All of the said folders will be coming directly from a table in my Oracle database. I can't find any documentation to help me get started on this project. Any suggestions?


Checkout the following, it has a nice filebrowsing features based upon update panel:
http://mattberseth.com/blog/2007/07/ajax_style_folder_browser_part.html
http://mattberseth.com/blog/2007/07/hwo_to_create_an_aspnet_ajax_s.html


Thanks, Kazi. Those were some helpful sites. I can use the gridview technique to populate my child nodes. My only problem now is how I would be able to populate the dropdownlist above the gridview to show a treeview structure of my whole directory. Thanks.

I think you can modify it to suite your need.


Thats cool example

Saturday, March 24, 2012

Wizard with Update Panel

I have a Wizard control with inupdatepanel . I am trying to create dynamic wizard steps in pagepre_init event, but it is giving me an error " object reference not setto an instance of an object" . without updatepanel it's workingproperly.

Thanks in Advance

Do you have a fileupload control in the wizard? If so,see this thread.

hello.

please post a simple page that reproduces this problem.

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...

Wrapper control for Slider Extender and Properties

I've written a control and that inherits from Panel and ITextControl. In CreateChildControls I create a table containing a text box and label, then I create the slider extender and properties pointing to the appropriate controls. The control loads properly (visually), but when I click the slider I get a series of javascript errors (Invalid Argument). If anyone has any suggestions they would be helpful.

Hi,

could you post the code that instantiates the slider extender?


/// <summary>
/// This web control class renders a Centralpoint console textbox.
/// </summary>
[ValidationProperty("Text")]
public class ConsoleSlider : Panel, ITextControl
{
private TextBox tbxSlider = null;
private Label lblTarget = null;
private SliderExtender seExtender = null;
private SliderProperties seProperties = null;

public ConsoleSlider() : base()
{
}

/// <summary>
/// This method is overridden to create the child controls of the console editor.
/// </summary>
protected override void CreateChildControls()
{
base.CreateChildControls();

HtmlTable table = new HtmlTable();
this.Controls.Add(table);

HtmlTableRow row = new HtmlTableRow();
table.Rows.Add(row);

HtmlTableCell left = new HtmlTableCell();
row.Cells.Add(left);

HtmlTableCell right = new HtmlTableCell();
row.Cells.Add(right);

tbxSlider = new TextBox();
tbxSlider.ID = this.ID + "_Slider";
left.Controls.Add(tbxSlider);

lblTarget = new Label();
lblTarget.ID = this.ID + "_Target";
right.Controls.Add(lblTarget);

seExtender = new SliderExtender();
seExtender.ID = this.ID + "_Extender";

seProperties = new SliderProperties();
seProperties.ID = this.ID + "_Properties";
seProperties.Minimum = 0;
seProperties.Maximum = 100;
seProperties.Steps = 1;
seProperties.Length = 300;
seProperties.EnableHandleAnimation = true;
seProperties.Orientation = SliderOrientation.Horizontal;

seProperties.TargetControlID = tbxSlider.ID;
seProperties.BoundControlID = lblTarget.ClientID;
seExtender.TargetProperties.Add(seProperties);

this.Controls.Add(seExtender);
}

/// <summary>
/// Gets or sets the control text.
/// </summary>
public string Text
{
get { this.EnsureChildControls(); return lblTarget.Text; }
set { this.EnsureChildControls(); lblTarget.Text = value; }
}
}


Hi,

mkerchenski:

seProperties.Steps = 1;

the problem is in the above statement, since it has no sense to set 1 step (it means 1 possible value, so there would be no need for a slider).

However, this is a "pathological" case that causes a bug since the slider extender is not able to handle this situation at the moment. I'll make sure to fix this for the next release.

Since the number of steps is the number of possible values, try to set steps > 1 and let me know if it solves the problem.

You can found a related threadhere.


I've tried a few different values for the Steps property and it doesn't seem to make any difference at all. If you disable script debugging (in IE) the control doesn't slide, and if you enable script debugging you get the error described initially. In the firefox javascript console I get the following errors:
Error: Found unclosed string '"'. Selector expected. Ruleset ignored due to bad selector.
Error: Unexpected end of file while searching for closing } of invalid rule set.
I'm not entirely sure they're related, but they're not there when the slider is not present.

Wednesday, March 21, 2012

Writing Games in ASP.NET AJAX

Hi All,

I was curious about usingAnimation behaviors in the toolkit to create games, but I found that they came up a bit short for this kind of task. So I wrote some behaviors and control extenders to allow sprite animation, collision detection, and some other fun stuff.

If you're interested in trying out this first version please check out thisblog post andproject page.

AndyBeaulieu:

Hi All,

I was curious about usingAnimation behaviors in the toolkit to create games, but I found that they came up a bit short for this kind of task. So I wrote some behaviors and control extenders to allow sprite animation, collision detection, and some other fun stuff.

If you're interested in trying out this first version please check out thisblog post andproject page.

That is so COOL! I am so trying this out... wonder if my bosses would let me put a shoot the fish game in our Government Applications.. you know... incase the customers get bored... could always bring back the amazing "Boss Key" :D

XHTML 1.1 Firefox and Opera problem

I installed AJAX Beta2 and used the CTP template to create a new web site. Which creates default.aspx page, with the doc type of:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
I have a table with images. I run the page in IE7 looks perfect. I ran in FF and Opera the cells height are 5 to 10 px to big. After pulling my hair for about 2 hours. I notice the doctype.
I set it to this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
And the table is correct (works in IE as well).
Should an AJAX site doctype be XHTML 1.1? Does it matter? Why did this break firefox on something so simple as a table?
Thanks
Rick 
AJAX should support site doctype XHTML 1.1 in the release version. I aslo find the similar issue to yours.The Ajax control size?is?somewhat?different?
in?different?browers?such?as?IE,FireFox,Opera,Safari.

Ajax, shorthand for Asynchronous JavaScript and XML, is a web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not have to be reloaded each time the user makes a change. This is meant to increase the web page's interactivity, speed, and usability.
The Ajax technique uses a combination of:
XHTML (or HTML) and CSS, for marking up and styling information.
The DOM accessed with a client-side scripting language, especially ECMAScript implementations such as JavaScript and JScript, to dynamically display and interact with the information presented.
The XMLHttpRequest object is used to exchange data asynchronously with the web server. In some Ajax frameworks and in certain situations, an IFrame object is used instead of the XMLHttpRequest object to exchange data with the web server, and in other implementations, dynamically added <script> tags may be used.
XML is sometimes used as the format for transferring data between the server and client, although any format will work, including preformatted HTML, plain text, JSON and even EBML. These files may be created dynamically by some form of server-side scripting.

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>

XML creation

I need to create an XML document that i can use in a "Cascading DropDownList". I need to make it for Care Make, Model, and Year. I'm not sure exactly how to set this up or anyone has already done this so i don't have to recreate the wheel but I would appreciate any help at all.

Thanks,
QWERTYtech

Here is part of the solution.

http://ajax.asp.net/ajaxtoolkit/Walkthrough/CCDWithDB.aspx

And here is the part with the XML file.

http://www.devx.com/getHelpOn/10MinuteSolution/20382

You can have the web service return the result of the XPath query depending on the one you want.


What would i do if a car was produced from say 1991 to 2005?

would i have to make an entry for each year?


Hi,

I think you need to. Personally, I'd suggest using database for such scenario.