|
hi
I need to know how can I create a browse button that user can specify the path to save a file that contain an DATA came from DATABASE
that mean I have a DATA and the USER wil press a button and specify the path to create a file contain the DATA
thanks
dadax
|
|
|
|
|
Hi there,
Do you mean you want to allow the user to select a location to save a data file sent from the server? Basically, your application is not allowed to access the IO system at the client side, so you may think of forcing the browser to display the Download dialog box with the SaveAs button so that the client can choose a place to save the file.
|
|
|
|
|
Hi,
I ahev a datagrid with editing capability. I implemented sorting bothways(Asc,Desc) on the grid. I would liek to isnert little up arrow and down arrow in the header columns of datagrid so that user will know in which order data is sorted.
All columns of grid are template clomuns
Can anybody plz help me ..
Thanks in advance!!!!!!!!!!
|
|
|
|
|
Hi there,
You can simply place an Image control in the header of the template column, then depending on the current sorting order you can set the ImageUrl property of the Image control properly.
|
|
|
|
|
i have a table for Users in my SQL Database
How do i integrate CreateUserWizard, ChangePassword asp server control to interact with
1. my Users table
2. SQL Server login i.e SQL Server authentication or Windows authentication
thanks for your anticipated help
t.aransiola
|
|
|
|
|
Hi there,
Basically, these controls work with the configured Membership provider and the default is the SqlMembershipProivder. If you want to use the controls with your own db schema, you can provide the handlers for the events of the controls such as CreatingUser or ChangingPassword. In the handlers, you can use your code to implement the functionality, and remember to cancel the event data so that the controls cannot proceed calling the configured membership provider. However, you should not use this way, you'd better implement your own custom provider, then simply configure your provider to use with these Login controls in the web.config file. You can read more about this in the links below:
http://msdn.microsoft.com/library/en-us/dnaspp/html/asp2prvdr02.asp[^]
http://msdn.microsoft.com/library/en-us/dnaspp/html/ASPNETProvMod_Prt1.asp[^]
|
|
|
|
|
Anybody ever done a preloader with ASPX? I have some reports that take several seconds to load and would like to have a preloader, partly so that users can't pound on the submit button.
You'd think it would be easy to piece together, but I can't get anything to work. Doing Response.Redirect or Server.Transfer in a preloader on_load doesn't show the preloader of course. Right now I'm just doing a meta refresh in a preloader page, but animated gifs will stop running once the refresh starts.
Surely somebody's dealt with this before... Am I missing something simple here?
Visit BoneSoft.com
|
|
|
|
|
I had a similar problem where some of our generated forms could take minutes. The page I had would refresh every 5 seconds. When it refreshed, it would check whether or not the form was done. If it was, then it redirected to the form. Otherwise it just went back to the page and continued to do the refresh. The form was being generated in a separate thread. The refresh was done with meta tags as well.
|
|
|
|
|
In case anybody else needs this... The following class will handle most of the preloader logic for you.
If you don't have a server side form in your page, set a label's Text to PreloadTool.GetPreloaderTable() and then use the StartRenderedPreload() method which will render the whole page for a preloader.
If you have a server side form in your page, the StartRenderedPreload() method will cause an Exception. Instead, use the StartPreload() method which renders only the result of PreloadTool.GetPreloaderTable() as your preloader. Example:
private void Page_Load(object sender, System.EventArgs e) {
PreloadTool pt = new PreloadTool(this);
if (!IsPostBack) { pt.StartPreload(); }
if (!IsPostBack) { pt.StopPreload(); }
}
Anyway, this is the utility class I came up with to help me out.
using System;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace WebReports {
public class PreloadTool {
private System.Web.UI.Page page;
public PreloadTool(System.Web.UI.Page page) {
this.page = page;
}
public void StartRenderedPreload() {
System.Text.StringBuilder sb = new System.Text.StringBuilder();
System.IO.StringWriter writer = new System.IO.StringWriter(sb);
System.Web.UI.HtmlTextWriter html = new HtmlTextWriter(writer);
page.RenderControl(html);
page.Response.Write("<div id=\"preload\">");
page.Response.Write(sb.ToString());
page.Response.Write("</div>");
page.Response.Buffer = true;
page.Response.Flush();
}
public void StartPreload() {
page.Response.Write("<div id=\"preload\">");
page.Response.Write(GetPreloaderTable());
page.Response.Write("</div>");
page.Response.Buffer = true;
page.Response.Flush();
}
public void StopPreload() {
System.Text.StringBuilder txt = new System.Text.StringBuilder();
txt = new System.Text.StringBuilder();
txt.Append("<script language='javascript'>\r\n");
txt.Append("if (navigator.appName == 'Microsoft Internet Explorer' || parseInt(navigator.appVersion) > 4) {\r\n");
txt.Append(" if (document.getElementById('preload')) {\r\n");
txt.Append(" var lmnt = document.getElementById('preload');\r\n");
txt.Append(" lmnt.style.visibility = 'hidden';\r\n");
txt.Append(" lmnt.parentNode.removeChild(lmnt);\r\n");
txt.Append(" } else if (document.layers['preload']) {\r\n");
txt.Append(" document.layers['preload'].visibility = 'hide';\r\n");
txt.Append(" }\r\n");
txt.Append("}\r\n");
txt.Append("</script>\r\n");
page.Response.Write(txt.ToString());
}
public string GetPreloaderTable() {
System.Text.StringBuilder start = new System.Text.StringBuilder();
start.Append("<link rel=\"stylesheet\" href=\"Report.css\" type=\"text/css\">\r\n");
start.Append("<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
start.Append(" <tr>\r\n");
start.Append(" <td class=\"TitleBar\">\r\n");
start.Append(" <img id=\"body_logo\" src=\"Logo.gif\" style=\"border-width:0px;\" />\r\n");
start.Append(" </td>\r\n");
start.Append(" </tr>\r\n");
start.Append("</table>\r\n");
start.Append("<table align=\"center\" valign=\"middle\" height=\"75%\" width=\"100%\">\r\n");
start.Append("<tr><td align=\"center\" valign=\"bottom\">\r\n");
start.Append("Generating report, please wait...\r\n");
start.Append("</td></tr><tr><td align=\"center\" valign=\"top\">\r\n");
start.Append("<img src=\"progress.gif\">\r\n");
start.Append("</td></tr></table>");
return start.ToString();
}
}
}
Visit BoneSoft.com
|
|
|
|
|
Hi all,
I have a windows forms client and a webservice application. I use the client to scan an image and send it to the webservice for processing. The webservice method receives the image file and saves it to disk before calling another module to process it. The following code is for clarity:
tempFile = @"c:\temp2\myfile.bmp";<br />
FileStream file = File.OpenWrite(tempFile);<br />
CopyStream(requestContext.Attachments[0].Stream, file);
On the development machine (Windows XP Pro), everything works fine but when I transfer the webservice to the testing machine (Windows Server 2003 Web Edition) I get this UnauthorizedAccessException. I gave full control rights to the ASPNET account on the server but still no use.
I use the following code to determine the owner of the webservice thread:
string name = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
I send "name" back in the exception message and I get that in fact the thread is running under this account: NT AUTHORITY\NETWORK SERVICE. Does that sound normal?
Could anyone please direct me to some kind of solution?
Thank you,
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
Sounds legit. Did you give that particular account access to your temp directory?
|
|
|
|
|
well, yes, there is NETWORK SERVICE in the list of users, I gave it full control but still got the exception. Now that I'm thinking about it, what's that NT AUTHORITY thing? is it like a computer name, like COMPUTERNAME\USERNAME thing? if so, I probably didn't give the permissions to the right NETWORK SERVICE. I could check on that tomorrow again (it's almost 11pm here). I also have an ASP.NET application running on the same server. I could try and make it do some file creation and saving and see what happens.
Don't hesitate to share any idea that comes to mind concerning that matter
Thanks again.
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
I know that DotNetNuke uses a lot of file manipulation and says that for Windows 2003 you need to give {Server}/NetworkService read, write, and change control. That's all I was thinking.
|
|
|
|
|
Hi again,
Finally I managed to make it work. I had to give read/write permissions to NETWORK SERVICE on the COM DLL file I'm calling from the webservice to process the image. Of course, WRITE permissions are also required for NETWORK SERVICE on the temporary folder
Voila, just thought of letting you know and post the solution in case someone gets the same problem some day.
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
Thanks for posting that. I forgot you were running the COM DLL under the calling identity. It's good to hear everything's working.
|
|
|
|
|
Hi everybody,
i was wondering if we could execute the code in a button before the postback...
because i need to save data from a placeholder in a database, before the postback of the page...
can wa do that??
Thanks
|
|
|
|
|
This is possible using AJAX and call backs...
However, why is this necessary? Is it not possible to fix this by putting an if not isPostBack in your page load method?
|
|
|
|
|
so if i want to use ajax like you said, can you tell me plz the event in javascript that i should work with if i want to use a button?
for example, if i used a dropdownlist, i have to use onchange..
thanks for the reply
|
|
|
|
|
Um, onclick...
But i have my doubts that you really need to do this... Unless you really have a need to perform this asynchronously like this, you shouldn't...
|
|
|
|
|
the thing is, i have a variable session that i increment each time i push the button... but the problem is that i have to add the controls in the load_page so i can't lose them.. so when i push the button like i said, the controls are being added again because the init and the load are executed before the button event..
see what i mean??
|
|
|
|
|
in your load_page wrap your control adding logic inside a
if (!IsPostback) {
}
So it only executes when it's not a postback. Problem solved.
Visit BoneSoft.com
|
|
|
|
|
hi paddy i'm facing the same problem.
actually my client don't want a postback of pages.
as u said we can do this by Ajax.but i don't have any idea abt Ajax could u send me some code to perform this.
u can reply me on amit_avesh@yahoo.co.in
thanx
Aavesh
|
|
|
|
|
Dear All,
How I can update multiple rows (with multiple column) , Values are from another Table.
Pls reply URgent
|
|
|
|
|
INSERT INTO TableA (AColumn)<br />
SELECT AColumn<br />
FROM TableB
|
|
|
|
|
I think its better to use a cursor, it is faster too.
|
|
|
|