|
Hi Priya,tx,for the reply.can u please give me the solution for the above question using c#.and also i need the page load event for the parent.
Many Thanks,
Harsha
hi
|
|
|
|
|
Sure…
Hope you understand that window.open(…..); should be written in javascript function which will be called when the user clicks the link of the parent gridview.
And in child window , I think, it is better to add an auto generated select button instead of a checkbox, if that doesn’t serve for a special purpose other than to indicate the desired row. Because, it may be ambiguous, if you check multiple checkboxes at a time. If you add select button, the user can select the desired row and click the button.
In button click,
//assign the primary key value of the selected row into a session variable
//For this, you should have assigned the primary key field to the DataKeyNames property //in the design mode(or at codebehind) of the gridview
Session(“var1”)=gvChild. SelectedDataKey.Value.ToString();
String scriptSubmit== " window.opener.document.forms(0).submit(); ";
If(!Page.ClientScript.IsClientScriptBlockRegistered(scriptSubmit))
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "script", scriptString);
string ScriptClose = " window.close();";
Page.ClientScript.RegisterClientScriptBlock(this.GetType, "Close", ScriptClose);
In parent window page load,
if(Session(“var1”)!=””)
{
//do the required using this session variable since this holds the primary key value of the record
// I’ve not written the code because I’m not aware of your exact requirement whether insertion or modification)
Session(“var1”)=””;
00000//better to clear the session even in the Session_End event of global.asax
}
Hope this may help you. You are welcome, if you have any queries regarding this.
-Vishnu Priya
|
|
|
|
|
i have a server that does not have internet access so when i ran my aspx project the flashes on the pages are not be shown.
normally on other pc's that have internet when i put on my web application it simply downloads flash from the internet if it is not installed.
i downloaded a shockwave version and ran it on the server and it said it was installed but my flashes are still not been shown.
anyone can tell me what i should or what i am doing wrong
|
|
|
|
|
Hi guys!
I'm creating a web application with a table containing files the users have uploaded to the site. Now for every entry in the table I have a little "trash" icon, so when clicked, the system will delete the file. Now - here is my problem: It doesn't work! Surprise huh! Well it seems like the Command event of the ImageButton never gets fired. I've tried having it throw an exception, but nothing happens, the page just reposts whenever the image is clicked.
I do not use the ASP.NET data table WebControl (the one you see in almost every tutorial about ASP.NET and data access) - because it does not fit into my needs. And to be honest: I don't like it that much either.
I have this code in my ASP.NET page's CodeBehind file's Page_Load method (please don't think to much about the variable names, as some of them are in Danish):
ImageButton imgb = new ImageButton();
imgb.CommandArgument = b.DbId.ToString();
imgb.CommandName = "Delete";
imgb.Command += this.DeleteFile;
imgb.ImageUrl = "~/Images/trash.gif";
imgb.ID = "cmd" + b.DbId.ToString();
I have this code in the "DeleteFile" method, which matches the Delegate for the Command event:
protected void DeleteFile(object sender, CommandEventArgs e)
{
Int32 bilagId = Int32.Parse(e.CommandArgument.ToString());
BilagHandler.Delete(bilagId);
throw new Exception("wtf!");
FillBilagTable();
}
The WTF Exception never gets throwed - ergo: The code never executes! Any clues? I'm really confused.
And perhaps this post is a stupid question, but I'm just code-blind by now - hey - so be it!
BTW: The code compiles without any errors.
Best regards
Soeren
|
|
|
|
|
Wire up the handler to the Click event, not Command.
|
|
|
|
|
It does not work either. Neither the Click or the Command event gets fired. I forgot to write, that I've tried the Click event as well.
Btw. the both the command event and the click event should be fired when the ImageButton is clicked. The Command Event gives me the benefit of having access to the CommandArgument, which can tell me the id of the file to be deleted. The click event cannot.
Best Regards
Soeren
|
|
|
|
|
Try this:
imgb.Command += new CommandEventHandler(this.DeleteFile);
EDIT
-------------
nm, saw you tried it with new as well...
Does it even do a post back?
Try setting the AutoPostBack property to true;
|
|
|
|
|
It does produce a postback. I've even tried setting the PostBackUrl property, even though it should not be necessary.
My theory is that I forgot to set some property that makes the ImageButton fire its events, but I can't find out which property it is. It makes no sense.
Best Regards
Soeren
|
|
|
|
|
Hi, to all...
In my project i open outlook page for new message, in subject i set some text (using C#) but in body i want to draw table (to set number of rows and columns using C#, this table should be same as we draw in MSWord. Hope I was clear).
|
|
|
|
|
hi,
is there any way to fill a GridView with the contents of a DataTable object? The object is correct, can see the values etc, but how do i display them in a GridView???
thanx
|
|
|
|
|
Can't you just set the datasource of the gridview to be the datatable, and call databind ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thank you for this! i'm very new to it, i thought you should have a datasource object for that, but as you said, datatable + bind worked great!
thank you
|
|
|
|
|
Is it possible to modify this control so that you supply it with an email address rather than your username?
Thanks,
|
|
|
|
|
It's default is with mail, so where do you think it will send the recovery options ?
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
Sorry I might not have explained it very well.
It will send you your email but first you have to supply the control with your username, then it will send you your password.
I want to change this and have the user supply their email address then have the password sent to that email address, of course being that the email address is in the DB. Also my membership has requiresUniqueEmail="true" so there will be no duplicate email addresses.
|
|
|
|
|
Noway, you must provide the username, I think it might be a way through the administrator tool.
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
What is the max file size limit that can be uploaded by File Upload control?
Can u give code to set the maximum file size in File Upload control?
Thanks and Regards,
sdaniel_cst
|
|
|
|
|
The maximum file size is controlled via config file. The maximum size for .NET1/1.1 is 1GB. For .NET2 it is 2GB. By default, the size is 4096K (4MB). To change the size, you specify the following:
<httpRuntime maxRequestLength="value in K" executionTimeout="3600" />
It is not a good idea to let this value get too big because ASP.NET loads the item into memory as it is uploading, so large values quite often result in Out of Memory exceptions.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks very much for your reply...
sdaniel_cst
|
|
|
|
|
If user is uplaoding large file through the application, then i want to allow them to do other work on the site. Means if a thread is processing file uplaod functionality then i want them to allow other works on the appllication.
Problem in Asynchronous call:
In this solution, i tried to execute, uploading functionality in to separate thread. For that, I created separate thread using delegate.BeginInvoke() method. Now, problem is that, In asynchronous call, I am able to upload file only in that case, when response from main thread is not returned. Once a response from main thread generated and sent back to the client then second thread gets “file not found” exception.
Problem in Popup window:
If i use popup window to open "file upload page", then that page will open in new window. Now, problem is that, if any processing is happening in this page at server side and user tries to do different things on other window (make a call to execute on the server e.g.. Click on “Cancel” link) then processing of this request queued until processing of "Upload File" page is not completed. Means request are performed sequentially.
I want them to allow user to do different task at the same time.
I am using ASP.NET 1.1.
If some one has any solution them please do the needful.
Thanks
Lokesh Gupta
.Net Developer
|
|
|
|
|
The reason that you can't do anything else while the file is uploaded, is that the web server only allows one page at a time to run for each user.
The solution is to disable SessionState for one of the pages.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Hi Guffa,
Thanks for updating me.I tried it in sample application and it worked fine. I found that, two saperate pages processed simultanenously using different threads.
But when i tried it in my application, it didn't worked.
I disabled sesionState for "Upload File" page, which open in popup window. Now, if uploading is going on and at the same time, if i wanted to do different things on different pages, then i found that, request were queued. I am not getting, where i am going wrong. Can you guess, what other settings may cause this to not happend?
Is there any other way to achieve the same without disabling the SessionState?
Means by managing threads in code.
Thanks
Lokesh Gupta
|
|
|
|
|
lokeshgupta13 wrote: Thanks for updating me.I tried it in sample application and it worked fine. I found that, two saperate pages processed simultanenously using different threads.
Then one of them is not processing the page any more, just running in the background. Once you end the response, it doesn't matter if you have a thread running in the background. This of course means that the background thread can't send anything to the browser any more, as the response has ended.
lokeshgupta13 wrote: I disabled sesionState for "Upload File" page
Is that the page containing the upload form, or the page that is recieving the file? Or are they the same? The page recieving the file has to be sessionless, as that's the one running while the file is uploading.
I have myself written an upload application that used a sessionless page for displaying upload progress, so I know that it's possible to do it this way.
lokeshgupta13 wrote: Is there any other way to achieve the same without disabling the SessionState?
Not unless you can get rid of the single page limitation in the IIS, but I really doubt that is possible. That could introduce threading issues, as you will have several threads running against the same session object. Also it would make the server much more sensetive to DoS attacks.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
In my case both the "Upload Form" and "Receiving form" are the same. I am using same form. I am not getting what is going wrong.
Thanks
|
|
|
|
|
Have you verified that trying to access the Session object in the page gives an excception, so that you are sure that the page is session-less?
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|