|
i have a parent page parent.aspx..when i click a link in a datagrid of that page a modal dialouge will open using showModalDialoug in javascript,its name child.aspx..
i cant get the session variables in that child.aspx
my code in parent.aspx is
Session("ForcastID") = 11
Session("ForcastType") = "s"
Response.Write("window.showModalDialog('child.aspx', 'Info', 'status=1, top=100, resizable=no, left=300');")
this will open child.aspx from parent.aspx
the values of session variables in child.aspx shows "Nothing"
|
|
|
|
|
ypki wrote: Session("ForcastID") = 11
Session("ForcastType") = "s"
Response.Write("window.showModalDialog('child.aspx', 'Info', 'status=1, top=100, resizable=no, left=300');")
it is not the problem of modaldialog. Try to comment the response.write. Then page will be posted back and session will be created. Now make the url in address bar as child.aspx ? Check whether you are getting session ? If you are getting then you can identify where is the problem.
|
|
|
|
|
|
Hi,
I have to write a page which receive a QueryString named LanguageID. In its Load event, after getting this parameter, I must remove it from the Request object. The reason is when the page is shown, and the user press F5 KEY (for example), the page will be refreshed without the QueryString LanguageID (This parameter is used only one time). I can image the scenario is like following:
Sub Load()
If not Request.QueryString("LanguageID") is Nothing then
strLanguageID=Request.QueryString("LanguageID")
Request.QueryString.Remove("LanguageID")'This line didn't work, the error is that the collection is read-only
Else
strLanguageID=GetLanguageIDFromDatabase()
End If
'Do other works
End Sub
How can I solve this problem? Any one can help me? Thanks.
|
|
|
|
|
Hi
Redirect to the same page after checking for querystring value. For example:
if (!IsPostBack)
{
if (Request.QueryString["test"] != null)
{
Response.Redirect("child.aspx");
}
if (Request.QueryString["test"] == null)
{
Response.Write("Query string is null");
}
}
Or, maintain in a session variable before redirecting to a child page. You can kill the session in the child.aspx.
Harini
|
|
|
|
|
|
Is there any reason why this code that worked in ASP.net 2.0 wouldnt work in ASP.NET 1.0 ?
(or am I going nuts ?...)
I am trying to set a value on an ascx usercontrol from its parent page
ascx code:
// this allows the page to set the name of the last CSR to work the customer
private string LastCSRName = "";
public string LastCSRNameMethod
{
get
{
return LastCSRName;
}
set
{
LastCSRName = value;
}
}
aspx code:
ReportsHeaderUrgent1.LastCSRNameMethod = Convert.ToString(DataBinder.Eval(SecondReturnedDataset, "Tables[rows].DefaultView.[0].CSRName"));
|
|
|
|
|
What error you are getting ?
|
|
|
|
|
Yes that would help huh
The error I get for the line in the aspx code is:
The type or namespace name 'ReportsHeaderUrgent1' could not be found (are you missing a using directive or an assembly reference?)
|
|
|
|
|
:(hello i use asp.net vs 2003. i tried reading from an xml file located on my drive but received access error every time. i created a dll file of a .cs class but whenever i tried to use after refrencing it,importing its namespace, and creating an instance of its class the dll found out the dll 's got nothing in it through object browser but when i use ildasm utility i get to see my class and methods in it . any help guess i cant work with filesystem. note i have imported allmost all namespaces.
and please i need a genuine log in script and how to make configure web.config to respond to it just not gettin it.
shawn
|
|
|
|
|
Since the asp.net by default runs under the aspnet user you need to give the machine user read and write access to where ever the xml file is. You also must give the IIS_WPG group read and write access.
I have recently written an article on dynamic web.config stuff, but it is for VS 2005. Here is the link anyway:
http://www.codeproject.com/useritems/SingleWebConfigFile.asp[^]
Hope that helps.
Ben
|
|
|
|
|
:(hello. i have an registration image on my registration page but the strings on it arent validating with onclick of the button. guess the strings on the image is refreshing itself without displaying the new random string in the image there by not moving i even tried calling the saved one from the directory to validate with it but not working.
shawn
|
|
|
|
|
Hi all,
Iam using form authentication in my web app. After user login i want to redirect depends on user info.
My problem is :
User.Identity.name is blank in login page but its working fine in other page.
Forms Authentication in web.config file
<authentication mode="Forms">
<forms name="Authcookie" loginurl="LogIn.aspx" protection="All">
private
void btnlogin_Click(object sender, System.EventArgs e)
{ if(checking User credentials)
{ Id=somevalue;
FormsAuthentication.SetAuthCookie(Id.ToString(),false);
Response.Write(User.Identity.Name.ToString());
//Response.Write(Context.User.Identity.Name.ToString());
}
}
pls help me...
|
|
|
|
|
hi
Anyone could help me in this.
Thanks
|
|
|
|
|
Hi all,
I am new to ASP.NET 2.0, The application is a Project management tool in ASP.NET 2.0 using VB.NET.... im learning the language for my thesis and and i would be glad of some help.
am using SQL server 2005 express edition database
I have 2 text boxes to fill called Project name & Project Manager.
I also have 2 text boxes for date started and due completion date.
A drop down list called "size".
A series of radio buttons grouped together.....choose one.
A check box for approval.
I also have 2 required field validators beside Project name & Project manager. They are displayed through a valiation summary at the bottom of the web page.
In my database i will have the following fields.
Project Name
Project Manager
Project Size
Date Started
Due Completion Date
Approval Yes/NO
|
|
|
|
|
Not sure what the question is here.
I would suggest better names for your columns:
ProjectName
ProjectManager
ProjectSize
DateStarted
DateDue
DateCompleted
Approval
You will also want an identity column to help with the table I would suggest ProjectId since I would guess the table should be called Project.
CREATE TABLE [dbo].[Project]
([ProjectID] [int] Identity (1,1) NOT NULL,
ProjectName varchar(255) not null,
ProjectManager varchar(255) not null,
ProjectSize varchar(255) not null,
DateStarted DateTime not null,
DateDue DateTime null,
DateCompleted DateTime null,
Approval Char(1) not null
)
Anyway, I don't know if that was what you were looking for or not.
Ben
|
|
|
|
|
Thanks for your reply Ben, as regards the table that what i was looking for.
What i want to know is the code for adding a record for the table when i click on my button "add prject" for example. The code that will fill all the fields in the table in conjunction with the text boxes and drop downs etc that i mentioned in my first post.
|
|
|
|
|
|
Greetings...
I'm interested in exporting a dataset or a datagrid to excel. The hard part is formatting excel so that certain fields are colored or setting each row to have an alternating color (much like that of the datagrid itself). Can anyone assist me in better understanding how to format the excel file, mostly for color in ASP.Net for VB before it is sent to the client to download?
If anyone has some insigh I would greatly appreciate it!!!!!
Thanks,
Shinkentb
|
|
|
|
|
this is a sampil code of my project
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:ReportsDBConnectionString %>"
="" selectcommand="SELECT [ReprotDate], [UserName], [ProjectName], [Report] FROM [Table1]">
how can make the data source read from variable tables ?
Ex:
x = TableName
SelectCommand="SELECT [ReprotDate], [UserName], [ProjectName], [Report]FROM X">
how can i do this in asp.net V 2.0 ???
Best Regards
Ahmed EL GEndy
|
|
|
|
|
x="Tablename"
Using C#
sqlcommand="Select field1,field2 from " + x + " order by field1";
Make sure that you put space after from and before order by clause.
Naveed Kamboh
Complexity kills, Write easy code for your self.
isolutionteam
|
|
|
|
|
I would NOT code it that way. Create a different stored procedures (or one with a tableName as a paramter). Use a switch statement to chose your stored procedure.
Dynamic SQL should only be done if absolutely necessary.
First of all, performance will be better if it stored procedures.
Secondly, stored procedures prevent SQL Injection.
Third, maintenance will be easier, especially if you change a table.
Fourth, if someone else sees your code, they won't think you are a complete beginner.
|
|
|
|
|
Why do you have separate tables with the same type of data in them in the first place? Why isn't the data in a single table?
---
single minded; short sighted; long gone;
|
|
|
|
|
If my Data Source is Microsoft Access Database File (OLE DB) iLL USE ALL oleDB cOMMAND
AND IF sql SERVER,sqL COMMAND LIKE sQLcONNETION IS ONE OF THE KEYWORD USED TO CONNECT TO DATABASE
iM USING SQL SERVER 2005 EXPRESS,THE COMMAND WOULD HAVE BEEN THE SAME TO SQL COMMAND LIKE sql
DataSource=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True IN THIS CONNECTION STRING CAM I ACCESS IT,IN SQK COMMAND LIKE "SQLcoNNECTION"
FOR AN ASP.NET DEVELOPER,WHAT WILL BE THE EASIEST DATA SOURCE CONTROL?
-IN ASP.NET ADMINISTRATION TOOL,ASPNETDB.MDF DATABASE CREATED INSTANTLY IN A DATABASE EXPLORER...IF IM GOING TO ACCESS MY OWN DATABASE AND NOT THE ASPNETDB.MDF,CAN I SET UP A MEMBERSHIP,ROLES AND PROFILE? CAN YOU GIVE THE HINT..CAN I ACCESS ASP.NET ADMINISTRATION TOOL AND SET UP A MY ASP.NET WEBSITE TO CREATE PROFILE,ALLOW ADMNISTRATOR AND USER, DENY ANONYMOUS USER?THAT MY WEBSITE CAN BE SECURED EVEN WITHOUT THE USING THE ASPNETDB.MDF
ONCE AGAIN THANKS FOR THE ANSWER.
|
|
|
|
|
Dear all,
I have an asp.net page which include asp table, i want to make it possible to drag and drop this table's columns
how should i do that???
Thanks
|
|
|
|