|
|
Thanks,
but this article is for the session state not forms authentication.
Even though much of the information/advices is useful for both of them.
I read on another msdn page (also other ASP.NET security sites) that they recommended always to use cookies.
But still I was wondering if you readers have some feelings or comments about this.
regards Patrik
|
|
|
|
|
Hi,
This is a basic question but since I am new with WEB development for me it is not so basic.
I use asp .net 2.0 and C#.
I have a page with some text boxes and other controls, the user can navigate from this page to
some other pages using LinkButton. Can I run some code on the page (using c#) before the new page loads?
I want to do it because I want to save some data in the Session object before loading the new page.
I thought about using PostBackUrl, but that means I need to use it on each control that can perform "post" on the page?
Do I have a simpler way doing so?
I will appriciate any help.
Thanks,
Yossi
|
|
|
|
|
The link button should raise an event on the page it is on (view the form and double-click the link button, Visual Studio should create a default event handler and even take you to the code it created). You can save the session there and do either a Server.Transfer("nextpage.aspx") or context.Response.Redirect("nextpage.aspx") to move to the next page.
Regards,
Keith
|
|
|
|
|
A typical way to handle this is to set the values in the session variable when the page is rendered to the client. This way the session object will be available when the user navigates to the next page via the link provided.
In ASP.NET 2.0 you can post back to a different page and have access to the previous page via the PreviousPage property. Depending on the information you need this may be better than storing data in a session variable.
|
|
|
|
|
I've found about 5 articles on how to insert a blank row into a datagrid. I've seen it using footers, using hidden columns, and adding a new row to the DataSource. I am curious of other people have tried the blank row and have found one way works better than another before I start going crazy with coding.
I am also interested in creating multiple blank rows. I have a nested datagrid and one may have the user enter multiple things. The main grid is to enter information about a part. The nested datagrid is to enter multiple subparts.
Thanks!
-- modified at 9:38 Wednesday 21st June, 2006
|
|
|
|
|
On my webform a have a datagrid containing bound columns. One of these columns is a status column.
Can anyone tell me how I could display a row of data in bold text (or different background colour) if the bound status column is a specific value?
All rows of data with a different status value must be displayed in non-bold.
Thanks for your assistance.
-- modified at 8:57 Wednesday 21st June, 2006
|
|
|
|
|
Just check if u get anything in ItemDataBound or else check out the following link
http://aspalliance.com/30
Thanks and regards.
|
|
|
|
|
Hi,
iam new to xml.I have a xml document where i have to search for a string or keyword and display it in a datagrid.Plz help me
Regards,
david Boon.
|
|
|
|
|
|
|
The samples and discussions on client callback ignores one big issue for me. They all POST to the same page; therefore, there is no speed benefit since all Request, Page, and UserControls/CompositeControls initializations are being called.
I scrapped my ClientCallBack and use XMLHttpRequest instead and redirect the request to a Generic Handler page. I still need to bypass Request event handler by checking if the request is intended for the the ashx page.
Dan Satria
Principal Consultant
Graha Logica, Inc.
|
|
|
|
|
Hi,
I have a webForm with 5 treeview controls. They are populated from a data set and they have checkboxes to post their values to another form.
In two of the treeview controls I don’t want to allow multiple selections in the check boxes so I assume that I need client validation the question is how ?
Thanks
|
|
|
|
|
Hi there,
+ You can use javascript to scan all the checkboxes of the treeview control based on thier ids to validate.
+ You can persist the current number of the selected checkboxed of the treeview. To do that you might use the client event onclick of the treeview control, you then use javascript to validate this value, you can also persist the value in a hidden field and use the CompareValidator to validate the control.
Just some ideas.
|
|
|
|
|
If you could give me an example how to would really help!
Thanks
|
|
|
|
|
Below is a quick example of client side validation so that more than 2 checked checkboxes are not allowed:
<%@ 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">
<div>
<asp:TreeView ID="TreeView1" runat="server">
<Nodes>
<asp:TreeNode ShowCheckBox="True" Text="Root1" Value="Root1">
<asp:TreeNode ShowCheckBox="True" Text="New Node 1" Value="New Node 1">
<asp:TreeNode ShowCheckBox="True" Text="New Node 2" Value="New Node 2"></asp:TreeNode>
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Root 2" Value="Root 2"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Root 3" Value="Root 3"></asp:TreeNode>
</Nodes>
</asp:TreeView>
<asp:TextBox style="display:none" ID="hidCheckBoxCounter" runat="server"/>
<asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="Oops! You cannot pick up more than 2 nodes." ControlToValidate="hidCheckBoxCounter" ValueToCompare="2" Operator="LessThanEqual"></asp:CompareValidator>
<script type="text/javascript">
var inputs = document.body.getElementsByTagName("input");
for(var index = 0; index < inputs.length; index ++)
{
var input = inputs[index];
if(input.getAttribute("type")=="checkbox" && input.getAttribute("id").indexOf("TreeView1")>=0)
{
input.on_click = CheckBox_OnClick;
}
}
function CheckBox_OnClick()
{
var counter = document.getElementById("hidCheckBoxCounter");
if(event.srcElement.checked)
{
counter.value++;
}
else
{
if(counter.value>0)
counter.value--;
}
}
</script>
</div>
<asp:Button ID="Button1" runat="server" Text="Submit" />
</form>
</body>
</html>
|
|
|
|
|
|
Hello All,
I have created a custom web control. This control contains three different textboxes. I place this control on web form. There is a button on web form. When I click on button, I need to access values of those textboxes. I appreciate if anyone can tell me how to access that value.
Appreciate your help.
Here is the code for Control.
public class MyControl : WebControl
{
private TextBox textbox1 = new TextBox();
private TextBox textbox2 = new TextBox();
private TextBox textbox3 = new TextBox();
[Category("Appearance")]
[DefaultValue("")]
[Localizable(true)]
[Description("This returns value of textboxes as string")]
public string TextBoxChars
{
get
{
this.EnsureChildControls();
return this.textbox1.Text + "-" + this.textbox2.Text + "-" + this.textbox3.Text;
}
}
protected override void Render(HtmlTextWriter output)
{
this.EnsureChildControls();
base.Render(output);
}
protected override void CreateChildControls()
{
this.Controls.Clear();
this.Controls.Add(new LiteralControl(
"<table width='100%' height='100%' " +
"cellpadding='3' cellspacing='3'>"));
this.Controls.Add(new LiteralControl("<tr><td width='100%'>"));
this.Controls.Add(textbox1);
this.Controls.Add(new LiteralControl("</td></tr>"));
this.Controls.Add(new LiteralControl("<tr><td width='100%'>"));
this.Controls.Add(textbox2);
this.Controls.Add(new LiteralControl("</td></tr>"));
this.Controls.Add(new LiteralControl("<tr><td width='100%'>"));
this.Controls.Add(textbox3);
this.Controls.Add(new LiteralControl("</td></tr>"));
this.Controls.Add(new LiteralControl("</Table>"));
}
}
- ashish
|
|
|
|
|
I just have to inherit control from INamingContainer
regards,
- ashish
|
|
|
|
|
OnInit()
{
...
this.textbox1.Text = Request.Form[textbox1.UniqueID].ToString();
...
}
or
bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
{
bool dataChanged = false;
if (postDataKey == this.UniqueID)
{
textbox1.Text = postCollection[textbox1.UniqueID];
Dan Satria
Principal Consultant
Graha Logica, Inc.
|
|
|
|
|
Hi
We have a webapp which the users pull large amounts of data from a remote system. The first user gets hit with the delay as this data is pulled back. It is then caches using Application[dataname] = thisdata. Subsequent requests pull the data from the cache and everybody is happy, and the first user calms down halfway through the morning!
We have had a trace on the data pulled back, and every morning, the same three sets of data are always requested. Is there anyway we can 'pre fill' the Application[] cache with these datasets before anybody hits the app? That's datasets in a loose sense of the term - not real ADO datasets. Sets of data is more correct.
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
Hi Angel,
IMO, you should use the Cache object instead of the Application to cache data as it provides you with a couple of ways to specify when you need to refresh the cached data based on the expiration policies or the dependencies. You can read more about this in MSDN:
ASP.NET Caching Overview[^][^]
|
|
|
|
|
Hi all,
My query returns 2 records in single variables I need to get the values in DataReader.
Ex: My query is :
SELECT schauditor_employee
FROM scheduleauditor , schedule
WHERE schedule_no = 1
AND schauditor_schedule = schedule_no
It returns two number say 4 and 5.I need to store it in some variable or say class property so that I can check these values on my form(Code Behind).
Please help.....Its Urgent...Thanks in advance.
|
|
|
|
|
here u got this example
SELECT table1.*,table2.* <br />
FROM table1, table2<br />
WHERE table1.column = value<br />
AND table1.id = table2.id
|
|
|
|
|
No thats not my problem.Actually When query is executes it returns 2 records say 4 and 5.Now I need to store this records.How do I do this???
|
|
|
|