|
No worries... Thanks again for your help.
I have resolved the issue by processing and producing the pdf on the first click, saving the ID to session state and then using a second click event to handle the creation of the file.
-------------------------------------------
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Just bugger off and leave me alone!!
|
|
|
|
|
I am trying to pass some parameters from one page to another. I have a project where if someone is a manager they can approve/deny certain requests. However, I am trying to display a message box alerting a user they cannot do certain functions. I created a simple example for her. I can click on a link on the first page that passes parameters in the URL. I grab the parameters. The problem is, it never displays the popup when I have response.redirect after it.
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Response.Write(Request.QueryString["OrderBy"].ToString());
Response.Write("<br /><br />" + Request.QueryString["Page"].ToString());
Response.Write("<script language='javascript'>window.alert("+ '"' + Request.QueryString["OrderBy"].ToString() + '"' +");</script>");
Response.Redirect("Default.aspx");
}
}
|
|
|
|
|
Well, of course. Response.Redirect happens on the server, the page with the script is never sent to the client. You need to write this script into the default.aspx page, or pre populate the page so that on the client side, when the action is performed, the javascript runs prior to the postback.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello, i have a real time data problem,
Let me explain,
Im building a web site, in order to user acces to check the status of an application, ive already have the process to keep update the data, ive an arraylist, where I put the modified data , the a timer updates the data, so, I have a data table … a static data table, so what I do , I just modify the data, with the editrow( ) function, then I pass the object to a dataview so the paga can be repainted, so everything goes well to that point.
Why I have static table, ok, first cause my fuction is static.. so.. then cause I need that the data be the same for other users, so when I run the page on a server all the users see the same data on the table.
Ok the problem comes when each user initializes the page, cause, the initialize process “try” does the process of adding colums to the data table , colums that already exist, so a error message pop ups, telling me that it cant be created again, ok so… what im doing,
First I cant use a non static data table, cause each time a user enters the page, it wont have any data, … so, im trying to have a non static data table, then when I get a modification on the data I use this, (Im passing the structure from the non static data table to the static)
DataTable static StaticDatatable =new DataTable()
DataTable static NonStaticDatatable =new DataTable()
if (loadatfirst == 0)
{
DtMotor.Columns.Add(new DataColumn("Numero", typeof(string)));
DtMotor.Columns.Add(new DataColumn("Nombre", typeof(string)));
DtMotor.Columns.Add(new DataColumn("Estado", typeof(string)));
DtMotor.Columns.Add(new DataColumn("RPM", typeof(string)));
DtMotor.Columns.Add(new DataColumn("UniqDevice", typeof(string)));
loadatfirst = 1;
StaticDatatable = NonStaticDatatable ;
}
so, at this point it seems to be no problem, so I have a static function that adds information to the StaticDatatable
StaticDatarow = StaticDatatable.NewRow();
StaticDatarow [0] = numeromotor.ToString();
StaticDatarow [1] = d.FriendlyName;
StaticDatarow.Rows.Add(StaticDatatable);
The problem comes, after this… Im trying to pass the data to the non static table just even up the to tables with a simple
NonStaticDatatable = StaticDatatable;
So if a new user enters the page, the nonstatictable creates as a new object but when its going to repaint the info, pass the information to the static, so if its repeted it doesn’t add in the first place, so it supposed that the only data it would be the new and the old, but no repeted data,
But when a new users enter nothing happened, the data table is empty, and I don’t know why…
[code]
public static DataTable StMotor = new DataTable();
public static DataRow SrMotor;
public DataTable DtMotor = new DataTable();
public DataRow DrMotor;
public void generategrids()
{
MotorsGrid.DataSource = CreateDataMotor();
MotorsGrid.DataBind();
}
protected ICollection CreateDataMotor()
{
if (loadatfirst == 0)
{
DtMotor.Columns.Add(new DataColumn("Numero", typeof(string)));
DtMotor.Columns.Add(new DataColumn("Nombre", typeof(string)));
DtMotor.Columns.Add(new DataColumn("Estado", typeof(string)));
DtMotor.Columns.Add(new DataColumn("RPM", typeof(string)));
loadatfirst = 1;
StMotor = DtMotor;
}
/*
StMotor.Columns.Add(new DataColumn("Numero", typeof(string)));
StMotor.Columns.Add(new DataColumn("Nombre", typeof(string)));
StMotor.Columns.Add(new DataColumn("Estado", typeof(string)));
StMotor.Columns.Add(new DataColumn("RPM", typeof(string)));
StMotor.Columns.Add(new DataColumn("UniqDevice", typeof(string)));
* */
DataView dv = new DataView(DtMotor);
return dv;
}
private static void FuncMotor()
{
bool repetido= false;
for (int i = 0; i <= numeromotor-1; i++)
{
if ((string)d.UniqueDeviceName == (string)CpSMotor.MotorUnique[i])
{
repetido = true;
}
}
if (repetido == false)
{
numeromotor++;
SrMotor = StMotor.NewRow();
SrMotor[0] = numeromotor.ToString();
SrMotor[1] = “info”;
SrMotor[2] = “info”
SrMotor[3] = “info”; //test
SrMotor[4] = “info”;
StMotor.Rows.Add(SrMotor);
}
}
protected void refrescar_Click(Object sender, EventArgs e)
{
//DtMotor.Merge(StMotor, false);
DtMotor = StMotor;
for (int i = 0; i < DtMotor.Rows.Count; i++)
{
DtMotor.Rows[i].BeginEdit();
DtMotor.Rows[i][2] = “info2”
DtMotor.Rows[i][3] = “info2”
}
DataView dv = new DataView(DtMotor);
MotorsGrid.DataSource = dv;
MotorsGrid.DataBind();
}
[/code]
the issue is, I need the data form the code behind object, be the same for al the users, cause the page automaticlly request for new information throug a java timer, so when a modify data appears the code behind update on the data table, and pass it to the dataview in order to be repainted when the request comes.
|
|
|
|
|
Use the Cache on the first read to cache the data and then retrieve it from their there for your other users.
-- modified at 9:18 Thursday 25th October, 2007
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi
i am doing a project on online exam so that i want to keep timer control, but i could not find timer control in my ASP.NET 2005 toolbox. how can i get it. Please help me.....
should i import it from any where:?
:->
|
|
|
|
|
if you want to just give the user a set of time, let say a 5 min, to answer it, just search for a java timer, and add the action you want to , like go to another page, or show a message...
search it in google...
|
|
|
|
|
thq for ur reply...
Your idea is very good, but i want to use timer control in ASP.Net, i used timer control(just drag and drop from tool bar) in console base application in C#, but i could not find the same control in Asp.Net tool box.
|
|
|
|
|
joshi reddy podduturi wrote: but i want to use timer control in ASP.Net
There isn't one.
joshi reddy podduturi wrote: but i could not find the same control in Asp.Net tool box.
Because there isn't one.
You need to write a timer in javascript. You can use AJAX to send messages to the server from your timer, if you want to, as Mark said. But, you are going to have to write actual code. To be honest, it's beyond me why anyone would drag and drop a timer from the toolbox in any C# application, it's not a UI element, it's something you control in code. If you want to be a programmer, you need to be willng to write code.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
When the other answerer said java, he meant javascript. You can store DateTime.Now in the session and check it on postback to see how much time has elapsed, but any sort of timer that causes an action eeds to be written on the client side.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
It's not necessary for a complete postback, an ajax call could be made from the client to obtain the time and url, or action, to take upon expiration.
only two letters away from being an asset
|
|
|
|
|
That much is true, but this guy wants to drag and drop something, you want to complicate thngs with AJAX ? I suspect that writing a JS timer is scary enough for him.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
m sachin here..
now i m working into libraty management system.In this system i have use .net with C# and database connectivity with microsoft access.now if user wants to register then it should enter his id.And if some new student enter id which is already registered then it should give an error so how can we do that..
please send me code or method
MIRCHI IS VERY TIKHI
|
|
|
|
|
The best option will be to take uid as a uniqueidentifier in sqlserver.
and handle the sqlexcetion in try catch block..........
another way is use DataReader to read data with sqlcommand select * from tablenaem where uid='"+tbuid.Text+"'"
if(dr.Read())
{
Response.Write("already exist");
}
else its okay.............
try this it may be helpful 2 u..........
Deepak Nigam
|
|
|
|
|
hello dear!!!
i m studing in B.E IT in 7th sem.
i need some asp.net project to study porpose so plese send me if u have good project which can improve my knowlege
MIRCHI IS VERY TIKHI
|
|
|
|
|
malcolm smart here dear!
Why don't you write a libraty management system in which you have database connectivity with microsoft access and if user wants to register it should let him unless his id is registered before then tell him it is so that is what you can do. Dear.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Oh dear!
Cheers,
Mircea
"Pay people peanuts and you get monkeys" - David Ogilvy
|
|
|
|
|
Buy a book, or read the articles on this site. Seriously....
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I am developing ASP.Net application in VS2003. From when user login, I am maintaining one session variable.
Session["user"] = t1.text; some think like this. and making it null and abandon when logout is clicked.
Session["user"] = ""
Session.Abandon() ;
When I run my code on localhost I dont have any problem. every thing works perfectly. but when I deploy my application to main server then aumatically my session get expires , I mean session variable is becoming is null. This does not happen regularly. It happens after few transactions. Even unable to replicate when exactly this is happening. I kept timeout 20 minutes.Then also even while operating it expires.
I am already frustrated with this issue by chanding <sessionstate> in web.config and many replacements in my code. but no use.
Can any please guide me?
Thanks In Advance
|
|
|
|
|
Check your cookies settings, ASP.NET handles the session in cookies, if your browser doesn't allow cookies then you will have problems like those you mentioned.
Let me know if that fix your problem.
Greetings,
Felipe
|
|
|
|
|
Hi,
Thank you for ur reply. but if it is because of cookie, it should not even work on localhost. but Its working fine on localhost. The problem is coming only when I deploy the to server. and browse it.
I have allowed all the cookies(by making the security level low). but still the same problem occurs.
Can you please guide me?
Thanks In Advance
|
|
|
|
|
I kept timeout 20 minutes.Then also even while operating it expires.
You can also set the session timeout in IIS.
Then u will solve ur problem of session expire.
like
IIS->defaultwebiste->(Urapplication)properties->homedirectory->configuration->options
Here u can set the session timeout.
Try this.
kissy
|
|
|
|
|
Kissy, Thank you very much for ur reply. But I am not getting problem at my local IIS. Its only coming when I deploy to main server. So I need to set the property at the server side. How can I set this at server side. Can you guide me? Do u think this problem is because of this property? If you think please guide me how to set this at server(which is not with me). Do I need to consult Administrator?
Thanks in Advance
|
|
|
|
|
You will see this behaviour if your session is running in-proc on a multi-processor system, or in a web-farm/web-garden. What you need to do is change the sessionstate to run under either SQL Server state, or as stateserver. Supposing that you are using the state server, then you need to start the ASP.NET state service on the server and add the following to your web.config.
>sessionstate
mode="stateserver"
cookieless="false"
timeout="20"
sqlconnectionstring="data source=127.0.0.1; user id=user; password=password"
server="127.0.0.1"
port="42424"
/>
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I'm working on a website on a machine running Vista, and using VS2005.
Even though IIS7 is installed, I am NOT running this site under IIS - I am running it from within VS2005.
When I run the site, it goes through some code to load a connection string the root web.config file. There is only one web.config file associated with the site, so there's no conflicts with trying to load an overriding file that may/may not exist.
When it tries to load the web.config file, I get an exception stating the following: Failed to access IIS metabase .
I have a co-worker that is also running Vista that doesn't have this problem. I have other co-workers that are running XP that do not have this problem.
Despite the fact that I'm not running under IIS, I've tried using aspnet_regiis -i , and even with the -ua to unregister asp.net, and then -i to re-register asp.net.
I'm going to go now and completely uninstall .net 2.0, and then reinstall it, but I'm not optimistic in a positive outcome. If this doesn't work, it's looking like I'll have to do a complete reinstall of this crapware they call Vista/.net, and then all my apps, etc, etc...
I'm not a happy camper. If .Net can be knocked over so easily, it still remains categorized as "crap" in my book.
Does anyone have any super-secret advice?
-- modified at 11:15 Wednesday 24th October, 2007
It seems as if you can't uninstall .net 2.0 from Vista, so that avenue is pointless. The more I use Vista, the more pissed off I get.
I've googled this problem to freakin death, and I haven't been able to find ANYTHING that will resolve this problem for me.
-- modified at 14:33 Wednesday 24th October, 2007
I just got done completely uninstalling VS2005, and then reinstalling it, and I still get the exception.
-- modified at 15:44 Wednesday 24th October, 2007
I'm running VS2005 as administrator.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|