|
|
Muruvet Kaplan wrote: cannot be serialized because it does not have a parameterless constructor.
That error message is clear right?
|
|
|
|
|
Hi,
as the error message is saying it, the FileInfo cannot be serialized/deserialized because the deserialization needs a constructor without parameters. So what you could do is to build your own FileInfo/DirectoryInfo class.
Also you could try to customize the deserialization process, but i'm not sure if this is possible.
Regards
Sebastian
|
|
|
|
|
http://www.dalepreston.com/Blog/2005/02/returning-custom-classes-from-web.html[^]
I want todo returning FileInfo type because i tried to file reading from server, but these files are encrypted and needed to be open from special project then read. the files are in server and size is out of 1 GB. my question is about a method to be able to read file from service and returning to the project...
Thanks for replies.
mkn
|
|
|
|
|
If you need infos about the file from the server, you have to create your own FileInfo-class containing the properties you need.
<br />
public class MyFileInfoClass {<br />
<br />
public Name { get; set; }<br />
public FullName {get; set; }<br />
<br />
}<br />
Just create this object before you return the result of your method and fill the properties using the FileInfo on your server.
Btw. if you want to read the content of the file you have to transfer the file and not the FileInfo.
Regards
Sebastian
|
|
|
|
|
the way you suggest, didn't solve my problem, if possible, please give me another solution
i defined the class MyFileInfo and as member used FileInfo member to get the variable type but same error occured
FileInfo in MyFileInfo cannot be serialized
mkn
|
|
|
|
|
You can not use FileInfo in your result because it is not deserializable. What I suggested was that you create your class containing some properties of FileInfo you want to transport through the wire. But pls do not use the FileInfo-Type within the result, it will not work.
|
|
|
|
|
i need a rich text editor in asp.net application which has master page too.
please can you give me some link for this.
thanks
|
|
|
|
|
bhavna4321 wrote: rich text editor in asp.net application which has master page too.
Rich text editor and master page?
ASP.NET has nothing to do with a rich text editor. Checkout free products like tinymce[^]
|
|
|
|
|
bhavna4321 wrote: i need a rich text editor in asp.net application which has master page too.
First of all there is nothing relation with Rich Editor control and master page. It can be placed in any content pages , so can easily displayed on master page.
You can Check for
fckeditor[^]
Or even if you search in Codeproject , there are some Excellent Java Script Editors available.
|
|
|
|
|
Hi,
I am working on sharepoin - infopath and asp.net application.
on one of the screen user can open the infopath form and enter data, on click on save button (designed on the from) it should save the form in a infopath library on a sharepoint portal.
But when i click on the button Save it throws following exception-
Request for the permission of type System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet grantedSet, PermissionSet deniedSet, CodeAccessPermission demand, PermissionToken permToken)
at System.Security.CodeAccessSecurityEngine.Check(PermissionToken permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, Int32 unrestrictedOverride)
at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.IO.StreamWriter.CreateFile(String path, Boolean append)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.StreamWriter..ctor(String path)
at TradeNetTCM_InfopathForm.TradeNetTCM_InfopathForm.CheckOutCheck()
at TradeNetTCM_InfopathForm.TradeNetTCM_InfopathForm.CTRL6_7_OnClick(DocActionEvent e)
at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)
can any one help?
Dipak
|
|
|
|
|
Hi,
sounds like the user does not have the permission to save the file. Check which user is editing the form and if this user has write-permissions in sharepoint.
Regards
Sebastian
|
|
|
|
|
I am ADMIN of the site and i have full access on it.
And I have created a service account which is used to impersonate the users, hence its not necessary that user has write access or not.
|
|
|
|
|
Well, maybe the service account is used to store the file. Where will the file be stored: at the server or at the client pc? Did you checked the event log (security and application)? The description of the error in the event log will contain the user who will be used to store the file.
|
|
|
|
|
Is it possible to split a Gridview column into multiple columns.
That is one data column arranged into multi columns.
Say my data is AAA BBB CCC DDD EEE FFF GGG HHH III and I want it arranged
as so
AAA DDD GGG
BBB EEE HHH
CCC FFF III
instead of
AAA
BBB
CCC
DDD
EEE
FFF
GGG
HHH
III
as automatically produced.
|
|
|
|
|
I think rather than GridView , Use Repeater Control .
|
|
|
|
|
Questions: Are there always nine columns or fields? Do you always need them in a 3x3 pattern? If so, I would not use a GridView. Assuming the data comes one row at a time from an ADO dataset or datareader, I would fill an asp:table dynamically, copying the data into dynamically created labels.
Someone's gotta be the last to know, but why is it always me?
|
|
|
|
|
Yes I reckon the only way to do it is use ADO dataset or datareader.
I just thought it might be possible to have one DATA field split into more than one GRIDVIEW column. The 3x3 pattern was just an example it could be any number of columns. Thanks.
|
|
|
|
|
Hi All,
I have a table that iam generating as a report from database. this table conatin several grids and i have an image in the background. When exporting to doc or rft file the backgroud is not exported. ANy ideas how can export the background image to doc or rtf.
|
|
|
|
|
Dear Friend
in my active directory user have multiple phone no then how i get all phone no from active directory?
Please Help Me///
Thanks
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Hello,
question#1:
i have designed my master page in which there is an image(image1) on which i have added 4 imagebuttons, now when i add any other control to my page then any or all of these imagebuttons are hiding behind the image1...
may i know the reason ??
question#2
$@N@
|
|
|
|
|
OK. You dont have to do that way. This is not Windows Forms. So just create a Table or on the < td > where you have placed your Image. set your "Image" as the "BackGroundImage". and then put your other "ImageButtons" on that Table or < td >. You can do this by using Overlapping < div >s, But it will not be displayed correctly over different browsers. So just go with the first option.
Question 2 ??? Comming soon !!!
|
|
|
|
|
Hi all,
I have a XML files that looks like this:
...
<dataset>
...
<p x="-0.979248" y="-0.00141319" />
...
</dataset>
...
I need to find the highest value of y. The files have 100 000 rows so it should be reasonable fast. But any suggestions are welcome.
|
|
|
|
|
Hi,
first of all i wouldn't use an XML-class to load the dataset, this will be propably to slow. Try to use a stream to read the file line by line. There you could extract the y-value using a regular expression, or if all values have the same length (y is at the same index in every line) access it by its index. Then store the highest y-value somewhere and compare every y-value with this one. If the current y-value is higher overwrite the stored value.
This algorithm has a complexity of O(n). If you are using multiple processors you could think about splitting the file in two or more parts and use threads to accomplish the task.
Hope this helps you a bit.
Regards
Sebastian
|
|
|
|
|
Ah, OK. This was my first idea to solve the problem. But being an "old style" .net programmer I thought there was a more effective built in way to do it.
Stream and loop, simple enough...
<p x = "-0.975586" y = "0.000274252"/>
<p x = "-0.975342" y = "0.000164965"/>
<p x = "-0.97583" y = "0.000365295"/>
<p x = "-0.97583" y = "0.000365295"/>
<p x = "-0.974854" y = "-1.00148e-005"/>
I'll skip the regex and find the position fo "y = " and "/>" and grab the string between those positions.
|
|
|
|