|
Hi all,
Any one please suggest me how to call a javascript function inside a asp:hyperlinkcolumn column. I want to call a javascript function when a user click the asp:hyper link text. In html link we can do tht using onclick function, is there any option like this in asp:hyperlink?
Also i need one more suggestion, plz suggest me some web sites from where i can learn Hibernate using .NET with some basic samples.
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
Exelioindia wrote: Any one please suggest me how to call a javascript function inside a asp:hyperlinkcolumn column. I want to call a javascript function when a user click the asp:hyper link text. In html link we can do tht using onclick function, is there any option like this in asp:hyperlink?
Add your JavaScript function call to the NavigateUrl property of your control.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hello Friends,
In my application i have to transfer a number of files from one folder to another folder on the same machine.
I am unable to fetch multiple files and also help me how to store these files to another location.
Thanks in advance............
Deepak Nigam
Deepak Nigam
|
|
|
|
|
Don't cross post in multiple forums. It's considered rude around here, and other sites.
|
|
|
|
|
Hello,
I have a small application that exposes various behaviors via dialog windows. I want to modify the application so that instead of popping up dialog windows it will simply show a new panel in the main window area.
My idea is to create several Panels to replace the dialog boxes. I want to be able to design these Panels in the designer just like you would design a new form.
The designer doesn't support this, so I must be barking up the wrong tree. I really want to treat each panel separately in the designer rather than just stacking all these panels on the main window (which makes it difficult to see what's going on).
Did I articulate that well enough? Any thoughts?
Thanks!
|
|
|
|
|
Is a user control what you are looking for?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
That's exactly what I'm looking for!
Thanks! (I accidentally selected "custom control" which is entirely different and confused my one-track mind).
|
|
|
|
|
Hey friends, I have been searching but couldn't find any examples where i can make my custom controls transparent (see through). Is it even possible to do in C#.
thanks
|
|
|
|
|
|
Did you try setting the controls backcolor to Color.Transparent?
|
|
|
|
|
I am controlling the paint method but when i set the style in the constructors it does funny thing but still my control is not tranparent
public UserControl1()
{
InitializeComponent();
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.BackColor = Color.FromArgb(0, 0, 0);
}
|
|
|
|
|
Isn't (0,0,0) black?
Did you try
this.BackColor = Color.Transparent;
?
|
|
|
|
|
Or pehraphs you could even use the correct overload, with that extra zero for the alpha channel. Which is what you want.
this.BackColor = Color.FromArgb(0,0,0,0);
Also, Color.FromArgb(0,0,0,0) == Color.Transparent; or at least the result is the same.
My current favourite word is: Nipple!
-SK Genius
|
|
|
|
|
Can anybody give me link or suggestions on implementing good exception handling mechanism in the C# project. Not just try...Catch block but beyond that.
I have something in mind,
1. Create something like Error Dictionary (resx file) with user-defined Error Codes, Description and build my own error information with user-defined exception class.
2. This class may accept error code or something for generating good exception object, which can be thrown to the consumer.
3. Exception Consumer will then use this object and pass it to Some class, which eventually will display Vista Type task dialog where atleast Title, Main Instruction and Description of the errors will be shown.
Any Inputs are very much appreciated.
Thanks
|
|
|
|
|
Why have a method return an error code which you pass to an error code processing method when you can just throw the appropriate exception when it occurs. Your stack trace looks right that way.
|
|
|
|
|
eggsovereasy wrote: Why have a method return an error code which you pass to an error code processing method when you can just throw the appropriate exception when it occurs.
Why? Obviously it's an exceptional condition.
led mike
|
|
|
|
|
Thanks for the reply. Only the thing i want to know is the best design to implement Exception\message Handling, using custom exception classes and resource files contains errors/message keys and descriptions.
Thanks
|
|
|
|
|
I represented the data in Crystal Report based on certain conditions. which is stored in a table "abc" .
I used CrystalReportViewer Control and my Crystal Report name is crystalreport1.rpt . and control name is crystalreportviewer1
I have a task to convert that report into pdf file and save into a folder(output) in Drive C: . and also to open that pdf file after creating the pdf.
My question is what will be the C# code to convert Crystal Report into pdf files and stored in that folder of drive C: .
|
|
|
|
|
I have converted this code from vb without testing, so please correct any syntax error ...
<br />
DiskFileDestinationOptions DiskOpts = New DiskFileDestinationOptions();<br />
oReport.ExportOptions.ExportDestinationType = CrystalDecisions.[Shared].ExportDestinationType.DiskFile;<br />
oReport.ExportOptions.ExportFormatType = CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat;<br />
DiskOpts.DiskFileName = ExportPath + requiredFilename;<br />
oReport.ExportOptions.DestinationOptions = DiskOpts;<br />
oReport.Export();<br />
crViewer.ReportSource = null;<br />
oReport.Dispose();<br />
oReport = null;<br />
<br />
Response.Clear();<br />
Response.AppendHeader("Content-Disposition", "attachment; filename=filename.pdf");<br />
Response.ContentType = "application/pdf";<br />
Response.WriteFile(ExportPath + requiredFilename);<br />
Response.End();<br />
<br />
<br />
Response.Redirect(pdffilenameandpath, true);<br />
<br />
-----
|
|
|
|
|
Is there any dll file needed to convert into PDF
|
|
|
|
|
A few statements from how I run a Crystal Report via a Windows Service:
Defile is a FileInfo indicating the RPT file.
reportfile is a FileInfo indicating the destination for the PDF.
CrystalDecisions.CrystalReports.Engine.ReportDocument crRpt =
new CrystalDecisions.CrystalReports.Engine.ReportDocument() ;
crRpt.Load ( Defile.FullName ) ;
crRpt.SetParameterValue
(
parm.Key
,
parm.Value
) ;
crRpt.ExportToDisk
(
CrystalDecisions.Shared.ExportFormatType.PortableDocFormat
,
reportfile.FullName
) ;
|
|
|
|
|
I am just learning XML and C# so I appoligize for any inconvience in advance. The program I am working on interfaces with another program that I did not write. I create a XML request for the program to do something and it responds with an XML response that tells me if it was succesful. The problem I have is parsing the response to find out if there are any errors. A basic response looks like this:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="7.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnErrror">
<CustomerAddRs statusCode="3110" statusSeverity="Error" statusMessage="The name was not valid"></CustomerAddRq>
<VendorAddRs statusCode="0" statusSeverity="None" statusMessage="Vendor succesfully added"></VendorAddRs>
</QBXMLMsgRq>
</QBXML>
The problem I have is that each of the elements could be different, as in this case, there is a VendorAddRs element and a CustomerAddRs element. I have been trying to use the XmlTextReader and XMLDoc to try and check to see if the statusCode is something other than 0.
A lot of the information I have found assumes that you know what element you are looking for. I don't care what the element is (if it's a customerAdd or a VendorAddRs) but really what the statuscode is and what the statusmessage is the code is anything other than 0.
I was thinking that I could just read through the xml and see if the node I'm at has any attributes, and if it does, check the first attibute to see if it starts with "statusCode" but that hasn't worked so far.
If there is an article or a post that someone could point me to, I'd appreciate it, as I have not had any luck finding an article that addresses this.
Thank you so much for your time.
|
|
|
|
|
If you know the attribute name you could use XPath:
XmlDocument myXMLDoc = new XmlDocument();
myXMLDoc.Load(responseStream);
XmlNode myAttribute = myXMLDoc.SelectSingleNode("//@attributeIAmLookingFor");
This is a very good XPath tutorial.[^]
-----
You seem eager to impose your preference of preventing others from imposing their preferences on others. -- Red Stateler, Master of Circular Reasoning and other fallacies
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
Wow! XPath seems really usefull for XML! Thank you very much for the article!
It appears that this is what I need. Since there can be multiple elements in one document that have statusCodes, I would venture to say that I should use:
XmlNodeList myNodeList = myXMLDoc.SelectNodes("//@attributeIAmLookingFor");
foreach(XmlNode n in myNodeList)
{
// Check the value of the node 'n' to see if it != "0"
}
I'm going to do some testing on this right now and then sit down and read up on XPath some more!
Thanks again!
|
|
|
|
|
hpjchobbes wrote: Since there can be multiple elements in one document that have statusCodes, I would venture to say that I should use:
XmlNodeList myNodeList = myXMLDoc.SelectNodes("//@attributeIAmLookingFor");
foreach(XmlNode n in myNodeList)
{
// Check the value of the node 'n' to see if it != "0"
}
There you go my friend!
If your document uses XML namespaces, it can get hairy. In that case, you will have 2 choices:
1) Use the class XmlNamespaceManager in your calls to SelectNodes, if your XML document uses prefixes.
2) If it does not use prefixes, you will have to resort to fully-qualified XPath queries, like:
//@*[local-name()='attributeIAmLookingFor' and namespace-uri()='http://somenamespace.com']
This is an alternative XPath syntax. Also, from your example above, you could save some code:
//@*[local-name='attributeIAmLookingFor' and namespace-uri()='http://somenamespace.com' and number()!=0]
Have fun!
-----
You seem eager to impose your preference of preventing others from imposing their preferences on others. -- Red Stateler, Master of Circular Reasoning and other fallacies
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|