|
|
I think there is OnFocus and onBlur event for every html input control for doing this.
|
|
|
|
|
Hi,
I am trying to disable some items in listbox through javascipt in ASP.net
These items are disabling in IE8 but not disabling in IE6. How can I do it?
<br />
var lstRight = document.getElementById("lstSelection"); <br />
var fixedFieldIds = document.getElementById("hdnFixedFieldId"); <br />
var fieldIdArray = fixedFieldIds.value.split('^');<br />
<br />
if(fieldIdArray)<br />
{<br />
for(var i =0;i<fieldIdArray.length;i++)<br />
{<br />
for(var j=0; j<lstRight.options.length; j++)<br />
{<br />
if(lstRight.options[j].value == fieldIdArray[i])<br />
{<br />
lstRight.options[j].disabled = true;<br />
break;<br />
}<br />
} <br />
}<br />
} <br />
|
|
|
|
|
This is no ASP.Net question. There is a seperate Web Development [^]forum for these type of questions.
In between, IE8 and IE6 have different rendering engine. You can use IE Developer [^]toolbar to take a dig into it.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I got all available network printers but the problem is when I select Microsoft XPS Document Writer as my printer and give print Then there is an error
|
|
|
|
|
Why did you ask two similar questions ? What is the error ? It probably relates to permissions to write a file on the server.
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
|
|
|
|
|
and Error is
himanshu
|
|
|
|
|
I want to get all network printers using ASP.NET &c# and want to avid the image printer like Microsoft Office Document Image Writer or Microsoft XPS Document Writer
|
|
|
|
|
You can't do that with ASP.NET. Not in any way. Unless your app runs over the same network, in which case, you can, assuming your client can see the same printers that your server can.
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
|
|
|
|
|
Hello,
I am using VS 2005 and following is the code:
Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fp As StreamWriter
Dim line As String
Dim filename As String = System.Guid.NewGuid.ToString & ".Txt"
Try
fp = File.CreateText(Server.MapPath(filename))
line = "Normal Text" & Chr(27) & "E" & " Bold Text" & Chr(27) & "F"
fp.WriteLine(line)
line = "Normal " & Chr(27) & "S 0" & " It should be superscript" & Chr(27) & "T"
fp.WriteLine(line)
fp.WriteLine(Chr(27) & "4" & " Italic Mode" & Chr(27) & "5") ' Italic mode
fp.WriteLine(Chr(20) & " or it should be superscript " & Chr(20) & "Normal")
fp.WriteLine(Chr(15) & "Girish Kumar Sharma" & Chr(18)) ' condensed mode
'fp.WriteLine(Chr(12)) ' Page Eject
fp.Close()
Catch err As Exception
err.ToString()
Finally
End Try
Dim fpforbat As StreamWriter
Dim strFilePath As String = "c:\\temp\\" & System.Guid.NewGuid.ToString & ".Bat"
fpforbat = File.CreateText(strFilePath)
Dim x As String = "Type " & Chr(34) & Server.MapPath(filename) & Chr(34) & " > PRN"
fpforbat.WriteLine(x)
fpforbat.Close()
'Dim strFilePath As String = "c:\\temp\\test.bat"
Dim psi As System.Diagnostics.ProcessStartInfo = New System.Diagnostics.ProcessStartInfo("cmd.exe")
psi.UseShellExecute = False
psi.RedirectStandardOutput = True
psi.RedirectStandardInput = True
psi.RedirectStandardError = True
psi.WorkingDirectory = "c:\\temp\\"
Dim proc As System.Diagnostics.Process = System.Diagnostics.Process.Start(psi)
Dim strm As System.IO.StreamReader = System.IO.File.OpenText(strFilePath)
Dim sout As System.IO.StreamReader = proc.StandardOutput
Dim sin As System.IO.StreamWriter = proc.StandardInput
While strm.Peek() <> -1
sin.WriteLine(strm.ReadLine())
End While
strm.Close()
Dim stEchoFmt As String = "# {0} run successfully. Exiting"
sin.WriteLine(String.Format(stEchoFmt, strFilePath))
sin.WriteLine("EXIT")
proc.Close()
sin.Close()
sout.Close()
'File.Delete(Server.MapPath(".") & "\" & filename)
'File.Delete(strFilePath)
My Two questions:
1.How i will get super/sub script printing ?
2.If i remove the comment from any of last two line, code do'nt run.. no printing. Why ?
Please guide me how to resolve the issue(s).
Thanks & Regards
Girish Sharma
|
|
|
|
|
Wow - what a nightmare this is. What are you trying to do ? Does this cause things to print on the print ? Why do you want to write code that prints stuff on the server ?
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,
Thanks for your reply. From the above code, i am creating a formated text file and one batch file which will be print the formated text file by using dos mode i.e. > PRN; but sir, problem is that if i wish to delete the formated and/or batch file, after run the code, i am not able to do so.
Regards
Girish Sharma
|
|
|
|
|
I repeat. Why do you want to emit a printout on the server ?
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 do'nt know, how to create the text file on client's machine; and what is another way to get the DOS mode (which runs faster) printing of a text file by asp.net, so please guide/help me in this regard.
Regards
Girish Sharma
|
|
|
|
|
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
|
|
|
|