|
The thing Christian wants to point out is that your application will use the printer installed on the server where you application is running. It means, every time the printout will be generated by the printer installed on the server, not on the machine from where you are accessing the web page.
|
|
|
|
|
At the first stage if it runs on server machine and printer; then my question will be how to access and client's printer to get printout. Actually, this is running fine on server printer but if i remove the comment from any of last two line i.e.
'File.Delete(Server.MapPath(".") & "\" & filename)
'File.Delete(strFilePath)
then no print out comes on the printer.
Please help me.
Regards
Girish Sharma
|
|
|
|
|
That may be because the print command hasn't finished when you delete the file but it isn't important if you want to print on the client machine anyway. Look into the javascript function window.print if you need to print client side.
|
|
|
|
|
None of this matters, you moron. You're printing on the server. Don't you read ? If you want to print on the client, none of the hideously ugly code you posted, will do that, nor is it possible to print in ASP.NET in any direct way through your code behind. Buy a basic ASP.NET book and read it, it's clear you have no idea what server side code is.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Sir,
I created the required formated text file with the help of above code. Now i wish to get print on Line Matrix Printer in DOS mode; so i read that it can be achieved by run a batch file. If it is not possible with the above code then; how do i print (DOS Mode) the generated text file at client machine on the click of a button in the web page, with the help of window.print and/or by any other mean please.
If you please provide me any link i shall be highly thankful to you.
Best Regards
Girish Sharma
|
|
|
|
|
Hi,
I have the requirement to encrypt my password with the PKCS #7 algorithm and store it to the sql server database. And to get the password also i need to decrypt with the same PKCS #7 algorithm. Is it possible with .Net code. Pls provide some help on how to do this encryption & decryption.
Tnx in advance
|
|
|
|
|
anandhakrishnan wrote: Is it possible with .Net code.
Of course.
There's a Cryptography namespace in .NET, if it doesn't support this algorithm, then google for code, or google for the algorithm and write it yourself. Either way, it's obviously possible in .NET, it's just a question of how much work you need to do yourself.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I am Using Visual Studio 2008 for creating a Web Application. While Viewing the details from A Grid View .. I am Getting these errors "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source error: Line 17
Line 15: img = CType(e.CommandSource, ImageButton)
Line 16: gvRow = img.BindingContainer
Line 17: TimeSheetID = gvTimeHdr.DataKeys(gvRow.RowIndex)(0)
Line 18: Session.Add("sessionMode", "cmdView")
Line 19: Response.Redirect("TimeEntry.aspx?TimeSheetID=" & TimeSheetID & "")
Can Anyone give a solution and the reason Why this error is generating
Thanks,
Arunaruby
|
|
|
|
|
Wow. This stuff just frustrates me so much. Why are you trying to be a programmer, if you won't even read the error messages, or learn to use the debugger ?
The error means what it says. It means that one of the two indexes you're looking up, is bigger than the collection, or it's less than zero. Learn to use the debugger, and trace through your code, to work out what the values are, then in the long term, write code that actually checks it's assumptions.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Arunaruby wrote: Line 17: TimeSheetID = gvTimeHdr.DataKeys(gvRow.RowIndex)(0)
try to use e.RowIndex (or) check whether you have written the bind inside the postback
|
|
|
|
|
iam finding many examples in webparts using sql server..will any body give the example on how to implement the webparts personalisation using oracle as db
|
|
|
|
|
Where is the issue ? What UI components you use, and what DB you connect to, are surely two different things ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
|
I have to connect three gridview and on the selection of row in the grid view it shud jump to the second grid view and vice-versa......For this I have hidden field in the grid view which takes the unique "ID" value and passes it to the next page. in the next page i use it with the help of query string and Programitically create second Grid view data source.
For e.g. CATEGORY->SUBCATEGORY1 works fine
SUBCATEGORY1->SUBCATEGORY2 DOESNT WORK...
It gives me this error
Invalid postback or callback argument. Event validation is enabled using <pages enableeventvalidation="true"> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
|
|
|
|
|
disable the EnableEventValidation to false. I think this is the way to overcome from this error.
|
|
|
|
|
that i did....bt its still givning error
|
|
|
|
|
how did you bind your grid,could you post your code...
use postback to bind your grid
if (!IsPostBack)
{
//Bind grid with query string id
}
|
|
|
|
|
If Not IsPostBack Then
Dim id As Integer = Request.QueryString("id1")
Dim db As Database = DatabaseFactory.CreateDatabase("See2Buy")
Dim cmd As String = ("Select CategoryID, SubCat2 from Categories where CategoryID=" + id.ToString())
Dim rdr As IDataReader = db.ExecuteReader(CommandType.Text, cmd)
GridView1.DataSource = rdr
GridView1.DataBind()
End If
|
|
|
|
|
This is depressing on so many levels. No-one is paying for this code, right ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Disabling event validation is bad. Quoting MSDN[^],
It is strongly recommended that you do not disable event validation. If you do disable event validation, make sure that no postback could be constructed that could have an unintended effect on your application.
This validation examines the post data and ensure the values supplied are known. You probably will be modifying some values at client side and this error will occur. So I guess you need to rethink your design.
|
|
|
|
|
Hello, I'm developing a ASP.net web page that will be deployed in production as http://apps.mycompany.com/mypage.aspx. I have to include header SSI available through a URL - http://testserver/global/header.html.
If I use the INCLUDE directive with the VIRTUAL keyword, I'm not getting the intended result. I'd appreciate if somebody can help me with how I can include the header from this URL into my page. Thanks in advance!!
|
|
|
|
|
I am populating a drop down list from AD, which is working fine (The drop downlist is populated when I browse to the site.) The problem I am having is that when I later go to use that data with dropdownlist.SelectedItem.Text, nothing is returned. Any suggestions?
Dim Groups1 As New DirectorySearcher<br />
Dim GroupSearchRoot1 As New DirectoryEntry("LDAP://OU=SomeOU,OU=SomeOU,OU=SomeOU,DC=SomeDomain,DC=SomeTopLevelDomain")<br />
<br />
With Groups1<br />
<br />
.SearchRoot = GroupSearchRoot<br />
.Filter = "(&(ObjectClass=Group)(CN=SomeGroup))"<br />
End With<br />
<br />
Dim Members1 As Object = Groups1.FindOne.GetDirectoryEntry.Invoke("Members", Nothing)<br />
<br />
For Each Member As Object In CType(Members1, IEnumerable)<br />
Dim CurrentMember1 As New DirectoryEntry(Member)<br />
dropdownlist.Items.Add(CurrentMember1.Name.Remove(0, 3))<br />
<br />
Some code to sort the dropdownlist alphabetically...
|
|
|
|
|
This looks messy and complicated. I also don't see any code to stop it running every postback, or any indication where it runs. If you run this code in page load, it resets the data source, and thus will cause the selection to be lost.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
The site is simply a one page form with a submit button, basically a web form for employees to use for new user requests. On submit a specifically crafted email is sent to our ticketing system creating a ticket for the various IT groups involved in New User setups. The ticketing system sends an email to an "Authorized Manager" asking for approval for the request. The drop down list is a list of Authorized Managers.
Currently the site is in prod, with a hard coded list of Authorized Managers, I am trying to improve it by using AD Security groups so that I don't have to manually maintain the list.
Should I ditch the above code and try something else, or is there some way that I can salvage it? I am just a script monkey Sys Admin trying his hand at "actual" prgramming to improve process.
|
|
|
|
|
Sorry for the vague question but I have a DLL that is my UI package from another project, now before I start a new project I wish to know, is porting over vb.net custom controls to asp.net controls relatively easy and straightforward as I'm making it out to be, or is there some complexity that wouldn't be apparent to me.
|
|
|
|