|
I was asked recently if I can create an ASP.NET application that among other things -can print data into specified fields on a "pre-printed" letter sized form.
My first impulse was to recreate a web page similar to the required form, have it filled out from the relevant datasource and just print the web page. Unfortunately this idea was scrapped because the application would have to use an existing stock of "official" blank forms.
As a newcomer to ASP.net I am not sure how best to approach this so my questions are-
*How should this be done?
*Is there some off the shelf control that can be used to accomplish this.
(give me the url if possible)
Thanks in advance.
simple one
|
|
|
|
|
You should probably consider whats known as a print style sheet:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dynstyle/printing.asp
|
|
|
|
|
Hi,
how do i retrieve the original source code of an asp file?
Thanks
Ashok
|
|
|
|
|
I'm not sure what you might want to do. Could you be more specific about your context?
|
|
|
|
|
'Menu' control has a property called TARGET. It may have 5 special values (starting with "_", eg."_blank"), or a custrom string, which is a name of the place, where pages should be loaded. I know its all in theory, but I couldn`t manage to force 'Menu' control to "put" selected pages into placed I wanted them. Could someone give me an example?
Suppose we have a masterpage with 2 placeholders, and I would like to load selected pages into first of them.
thank you very much for help
|
|
|
|
|
These two things are different, the Target property allows you to specify the window/frame to display the output html markup of the web page. The placeholder control in the master page is to reserve a place that you can provide dynamic contents in the content page. So if you have two placeholders in the master page and you only want to provide the content in the first one, then in the content page you can use a single content control to work with the first placeholder control.
|
|
|
|
|
Hi All,
I am using ASP.net 2.0 and I need to use the System.Windows.Forms.FolderBrowserDialog, so web users can select a directory on their local pc. to achive this I have created a simple windows control that had one button and opens
up FolderBrowserdialog box.
here is the coder for it
"using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Security;
using System.Security.Permissions;
namespace DirectoryViewer
{
public interface intDirGet
{
string DirLocation { get;set; }
}
public partial class UserControl1 : UserControl,intDirGet
{
string _DirectoryLocation;
public string DirLocation { get { return _DirectoryLocation; }
set {_DirectoryLocation=value;
this.txtDirLocation.Text= value;}
}
public UserControl1()
{
InitializeComponent();
}
private void btnShowDirectory_Click(object sender, EventArgs e)
{
if(fbd.ShowDialog() == DialogResult.OK)
{
DirLocation = fbd.SelectedPath.ToString();
}
}
}
}
"
I have added the dll generated by this custom user control from (...\controllib\bin\debug\)to root directory of the my asp.net page
<object id="DirectoryViewer" classid="http:DirectoryViewer.dll#DirectoryViewer.UserControl1" />
When I try to run this app using the debugger or even when I relase it, I get the following error.
"System.Security.SecurityException: Request for the permission of type
'System.Security.Permissions.FileIOPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed."
I have tried to change my IIS settingto Windows Authantication and I
have add <identity impersonate="true"/>
Do I need to do anything with the WindowsControl.dll? or what can I do
to get around this problem.
Thanks Leyla
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Security.SecurityException: Request for the permission of type
'System.Security.Permissions.FileIOPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand,
StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.Windows.Forms.FolderBrowserDialog.get_SelectedPath()
at ShowDirectoryButton.UserControl1.btnShowDir_Click(Object sender,
EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.FileIOPermission
The Zone of the assembly that failed was:
Intranet
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
ShowDirectoryButton
Assembly Version: 1.0.2414.26587
Win32 Version: n/a
CodeBase: http://localhost:4496/ShowDirectoryButton.DLL
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Accessibility
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
Microsoft.mshtml
Assembly Version: 7.0.3300.0
Win32 Version: 7.0.3300.0
CodeBase:
file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
|
|
|
|
|
|
Hi All,
I am in a need where I have to develop a new control,
which should act as HTML FILE CONTROL, but it should browse server machine's folders. The path I selected need to be stored in db.
The hardle here is .. to browse server's file system.
I only know System.IO can help a bit, but not sure how far it is helpful.
Please guide me in this regard..
1. Any existing control solves my problem.
2. Do I need to develop a screen using System.IO name space..
Please let me know if any other alternate can make my way clear.
Thanks in advace..
Chinna
|
|
|
|
|
chinna82 wrote: 1. Any existing control solves my problem.
I don't know of any control to do this.
chinna82 wrote: 2. Do I need to develop a screen using System.IO name space..
Basically, you can use the classes defined in the namespace System.IO to access the directory tree at the server side, and use a server control like the TreeView to display this structure at the client side.
|
|
|
|
|
Hi
I have a web page which takes long time to process and display a complex datagrid when a button is clicked .
I would like to display a "please wait loading " message in the same webpage.
I have gone through few articles here but not found those which display in same page without redirection to another page.
I wud appreciate any timely help.
Thankx
Pretty
|
|
|
|
|
|
Hi
I have a web page which takes long time to process and display a complex datagrid when a button is clicked .
I would like to display a "please wait loading " message in the same webpage.
I have gone through few articles here but not found those which display in same page without redirection to another page.
I wud appreciate any timely help.
Thankx
Pretty
|
|
|
|
|
If you happen to post the same question in two or more posts, you might want to delete the redundant ones.
|
|
|
|
|
I have 10 comboboxes and 10 textboxes in my aspx page.Each combobox has to be filled with 50 values.so if we calculate total records it comes around 510.Most of the articles says that datareader is faster than dataset.But since i have more controls and more values, it has to go to database again and again to fetch values. I can use stored procedure and fill the dataset at once, so that i can avoid the roundtrip. Guys can you tell me which one is better in this situation dataset or datareader and if possible the reason.
Thanks
|
|
|
|
|
Are you trying the DataReader with multiple results? I'm not sure which one is better in your case, you may create some benchmarks and investigate. However, if they don't produce any significant difference, then both are applicable.
|
|
|
|
|
hi,
I had similar situation and I ended up using the datareader option with multiple result sets from the database. From my own observations the datareader option seemed to be faster. Since I was only reading this data into objects on the web page- then there was no nead for the extra functionality in the Dataset.
to parse the data into the comboboxes(DropDownList) and textboxes I used while loops and the .NextResult() method.
Wherever the data in some of the the combo boxes was identical (I had 2 combo boxes with this scenario)- then I used a while loop to read the values into a listItem object then I added it to the two combo boxes. here is an example of this below...
(N.B. dr is my datareader object)
<br />
while (dr.Read())<br />
{<br />
ListItem NewItem =new ListItem();<br />
NewItem.Value =dr.GetInt32(0).ToString();
NewItem.Text =dr.GetString(1);
combo1.Items.Add(NewItem);<br />
combo2.Items.Add(NewItem);<br />
}<br />
hope this helps.
simple one
|
|
|
|
|
Hi ,
I need to call a method written in c# windows application from a C# web application,Is it possible? if yes then how?
Thanks in advance for your help.........
|
|
|
|
|
I think the simple way is to add reference to the windows appication as you would with a normal assembly, then you can call this method. If they are two running applications, then you may consider using a remoting to invoke an object in the windows application from the web.
|
|
|
|
|
Hi,
Thanks for your help...actually i m new to asp.net ..so dont have much idea about remoting but i read about remoting today what it says is ....it allows to invoke a method in a remote application from another application ..but both the applications has to be windows application ....i have searched alot to find an example that demonstrates how a web application invokes a method in windows application but couldn't find any....if u have any idea on this do reply.
Thanks
|
|
|
|
|
pannujagwinder wrote: .but both the applications has to be windows application ..
Actually, the basic requirement for the communication using the .Net Remoting is that both applications run on the .Net environment. So you can invoke an object hosted in the window application from an ASP.NET application.
|
|
|
|
|
Hi,
yes I Agree that the basic requirement of .Net remoting is that both the applications run on .net environment..... by windows application i meant the desktop application written in c# and a web application written in c#..can they communicate ?? i mean can we call a method written in a desktop application not in a class library project but in a simple desktop application from a web application ? if yes how?
Thanks
|
|
|
|
|
pannujagwinder wrote: can they communicate ?? i mean can we call a method written in a desktop application not in a class library project but in a simple desktop application from a web application ?
Yes, they surely can.
pannujagwinder wrote: if yes how?
Your window application can expose an object which can be remotely accessible, and basically the client wants to call the method defined in the window application should be able to access this object, and then call the method via this object. For more details on how to implement it, you can see MSDN[^]
|
|
|
|
|
Dont know if this is exactly what you want but this will run the application itself:
using System.Diagnostics;
...
Process myProc;
// Start the process.
myProc = Process.Start("filename");
//The process does something.
...
// Stop the process.
myProc.CloseMainWindow();
Otherwise if you want to just execute the method then you should consider using reflection:
http://www.csharphelp.com/archives/archive200.html
|
|
|
|
|
Hi,
Thanks for your help...actually i m new to asp.net ..so dont have much idea about remoting but i read about remoting today what it says is ....it allows to invoke a method in a remote application from another application ..but both the applications has to be windows application ....i have searched alot to find an example that demonstrates how a web application invokes a method in windows application but couldn't find any....if u have any idea on this do reply.
Thanks
|
|
|
|