|
Hi
I am confused regarding the statement All Web controls must be placed within a tag to function properly. I have added the following to a webform
<asp:literal id="Literal1" runat="server">
in the code behind I have the following Literal1.Text = "Hello World";
I do not have the web contorl within tag so how come it works.
I have also found that I can place other web controls on a web page and not have them between a tag and they work fine.
I would appreciate it if some one can explain this to me
Kind Regards
|
|
|
|
|
Hi,
It also confused me initially.
But what I found is that, only those web controls which needs a form tag to function are needed to be placed inside a form with Runat="server" attribute. I mean to say, when a form is submitted the value of the controls which will be posted back are of the above type. Thus textbox need to placed inside a form with runat="server" but for a label it is not mandatory.
I hope this answers your question.
Thanks,
Pradipta Basu
|
|
|
|
|
Only the controls that are rendered as form fields in the html code need to be inside the form to work.
The reason they do is that when the form is posted, only the data from the fields that are within the form is included in the request.
---
single minded; short sighted; long gone;
|
|
|
|
|
hai,
i am using asp.net1.1, i Want to implement ajax controls .Any freely downloadable ajaxcontrol toolkit is available?
Thanks and regards,
surendra
|
|
|
|
|
AJAX is not that hard. I'm sure there are toolkits ( google for it ), but with a good book, you shouldn't need them, unless you're just hoping to get a bunch of stuff for free ). Thre's no reason I Can see for the MS toolkit to not work in 1.1, apart from politics.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i have downloaded microsoft Asp.netajax controlToolkit,but inorder to use i have to run the solution file in vs.net2005,but i am using vs.net2003,
please send some more possibilities ,if u know
Thanks for ur reply
surendra
|
|
|
|
|
I knew that, I said there is no reason, bar politics. In other words, it doesn't work because they don't want it to, but there's no reason you can't find other toolkits on the web.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I've been spending numerous hours on this project and haven't been able to find a solution or anything close to my problem on the internet or this site.
The Project: Integrate VBScript into an HTML page to allow for reading registry keys.
Working Parts?: So far I believe I've coded the VBScript correctly to read the registry and store "Description" value into Card1. The next thing I'm trying to do is use a HTML drop down menu that updates the menu from information read in the registry.
The Code:
<title>Drop-down Network Card Menu
Choose Network Card
Card1
cNICCard1
Any help would be fabulous
If I get it figured out by myself I'll be sure to update this post for ya'all.
|
|
|
|
|
Greetings to you!
I think I've found a bug but not sure. So would like to hear your opinion on this issue.
It happens when I try to use Response.Cache.AddValicationCallback method in ASP.NET 2.0.
It seems that when using HttpValidationStatus.IgnoreThisRequest option the cached page is actually invalidated
and the most recent version is cached. Not sure if it's a bug or the intended behaviour in ASP.NET 2.0.
As written in MSDN documentation for the IgnoreThisRequest option (HttpValidationStatus enum):
"IgnoreThisRequest - Indicates that the request is treated as a cache miss and the page is executed. The cache is not invalidated. "
To try this I used simple test.aspx page with the following directive
<%@ outputcache duration="1200" location="server" varybyparam="none" %>
the page itself has a current time code only : current time is: <%= DateTime.Now %>
in the code-behind file I have implemented validaton callback:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Web.Caching;
public partial class test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.AddValidationCallback(new HttpCacheValidateHandler(DoCallback), null);
}
public static void DoCallback(HttpContext context, object data, ref HttpValidationStatus status)
{
if (context.Request.QueryString["d"] == "true")
status = HttpValidationStatus.IgnoreThisRequest;
else
status = HttpValidationStatus.Valid;
}
}I hit the page a couple of times to make sure it is cached, then I add querystring parameter "?d=true" and it all seems fine so far, every time fresh page is executed.
But then, when I remove querystring parameter and hit the page, not the previously cached page but the page with the most recent time is displayed and cached as well.
Do you think it's correct??? What's your opinion on this?
|
|
|
|
|
I have Created 2 Tables inside the DataSetAUDITLOG
1. AuditLog
2. CountLessons
I have deleted the table CountLessons from DataSet and Report and I am not using CountLessons table anymore. As before I got the Same Problem, On that time I deleted the DataSet and .aspx and .rdlc
Thanks
Sarfarj Ahmed
|
|
|
|
|
I am exploring the DataGrid and DetailsView functionality in 2005. This is the WalkThrough I used:
http://msdn2.microsoft.com/en-us/library/stc0szde(VS.80).aspx[^]
I got a question for the DetailsView field that was filled from datasource, is there anyway I can set it to a drop down list so that when people wants to update, they can select from drop down list instead of key in the value?
|
|
|
|
|
hi there...
are you making the fields as template fields? if no, convert them into template fields from the smart tag of the detailsview and then in the edit template of the particular field, replace it with an asp:dropdownlist control with the required list items/ sqldatasource.
hope this helps...
Murthy here
|
|
|
|
|
Thanks Murthy!
I tried this and it worked. But I got a new problem of how to set the selected value in this drop down list when I want to update it.
I appreciate any answer.
|
|
|
|
|
Hi there,
Can you post your gridview code for that particular template field?and the sqldatasource?
thanks,
Murthy here
|
|
|
|
|
Hi Muthy,
The template is actually in Detail View. By select a value in Grid View, a Detail View will show up and in the Detail View, you can add/update/delete records. So I changed the UpdateParameter and InsertParameter in the Detail view like below but got this exception:
'ddlProgress' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value
Here is the code for the update parameter and datasource:
***************************************************************************
<br />
<br />
<br />
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:cs1%>"<br />
UpdateCommand="spUpdReport" UpdateCommandType="StoredProcedure"><br />
<UpdateParameters><br />
<asp:ControlParameter ControlID="GridView1" Name="StatusActivityID" PropertyName="SelectedValue"<br />
Type="Int32" /><br />
<asp:ControlParameter ControlID="DetailsView1$ddlProgress" Name="ProgressID" PropertyName="SelectedValue" /><br />
<asp:Parameter Name="StatusActivityID" Type="Decimal" /><br />
<asp:Parameter Name="DateEntered" Type="DateTime" /><br />
<asp:Parameter Name="ProjectName" Type="String" /><br />
<asp:Parameter Name="ProjectDescription" Type="String" /><br />
<asp:Parameter Name="WaitingOn" Type="String" /><br />
<asp:Parameter Name="DueDate" Type="DateTime" /><br />
<asp:Parameter Name="ExpectedCompletionDate" Type="DateTime" /><br />
<asp:Parameter Name="ActualCompletionDate" Type="DateTime" /><br />
<asp:Parameter Name="Priority" Type="Decimal" /><br />
<asp:Parameter Name="UpdatorID" Type="String" /><br />
<asp:Parameter Name="DivisionID" Type="Decimal" ConvertEmptyStringToNull="False" /><br />
</UpdateParameters><br />
</asp:SqlDataSource><br />
<br />
***************************************************************************<br />
and here is the template and datasource for the Progress(which I want to use a drop down list to display, ProgressID is the value and Progress is the name for the drop down list)<br />
<br />
<asp:TemplateField HeaderText="Progress" SortExpression="Progress"><br />
<EditItemTemplate><br />
<asp:DropDownList ID="ddlProgress" runat="server" DataSourceID="SqlDataSource3" DataTextField="Progress" DataValueField="ProgressID" SelectedValue='<%#Bind("Progress")%>'><br />
</asp:DropDownList><br />
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$connectionStrings:cs1 %>"<br />
SelectCommand="SELECT [ProgressID], [Progress] FROM [Progress]"></asp:SqlDataSource><br />
</EditItemTemplate><br />
<ItemTemplate><br />
<asp:Label ID="Label1" runat="server" Text='<%# Eval("Progress") %>'></asp:Label><br />
</ItemTemplate><br />
</asp:TemplateField><br />
<br />
<br />
*****************************************************************************
Thank you so much for your help!
Alex
<
-- modified at 11:49 Friday 11th May, 2007
|
|
|
|
|
Hi All...
I have a form which inserts customers data in SQL Server database, and I add a submit button to add the data on event on_Click, I want the submit button to be fired always either when the user or when the user clicks by mouse(which is not a problem) or when he presses enter(here is the problem)...
Have a nice day
|
|
|
|
|
What error you get (if you get any error)? Otherwise first set focus in button then press enter
|
|
|
|
|
The solution is to put all the controls that accepts user input and your submit button into the same panel control. On the panel control, there is a default button property. Set the default button property with the ID of your submit button. This will take care the problem.
Rookie Programmer
|
|
|
|
|
hi Dear...
I cannot find the default button property for the button
Thanks alot...
|
|
|
|
|
Hi Dear...
I did that, but i didn't find the default button property..
Regards
|
|
|
|
|
Thanks dear...
It worked
Have a nice day
|
|
|
|
|
Do you have more than one textbox on the page? Is the submit button the first button in line? Is this 1.1 or 2.0?
Cleako
|
|
|
|
|
Dear
It's 2.0 problem, and I have many textboxes and a single submit button, the submit is the last control in the form..
Regards
|
|
|
|
|
hi friend
I too faced the same problem(posted in the forum too) but i couldnt make up by assigning any properties or coding.
What i did is, just cut all the other buttons(in case of WebControl button) leaving the button to be clicked while hitting 'Enter' and again pasted the other buttons in their position. This worked(meaning that Submit button has the prior tab index=0)
Or
In the textbox's KeyPress Event,check for the KeyCode(say 13 for Enter Key) and if so, call the button's click.
Try and let me know if you have any problem.
|
|
|
|
|
Try the Following code:-
Page.RegisterHiddenField("__EVENTTARGET", "btnClick")
Everything Is Possible!
|
|
|
|