|
I am having difficulty checking out a document using a SharePoint web part. I am using the default security credentials (System.Net.SystemNetworkCredentials) but I get an error saying that I am unable to check out the document.
I own the document in question and can check documents out through the standard web part supplied by the SharePoint server to access the document repository.
I use the same code in a desktop application and can check out documents but fail when trying to check them out using a web part.
I suspect that the SharePoint Service is getting the network credentials from the ASP.NET web page which is owned by the SharePoint server and not my network credentials like when I execute the code from a desktop application I wrote as a prototype.
Does anyone know how I can substitute a user’s network credentials for the default network credentials from a SharePoint web part?
The code I use is below.
SharePoint.Document_Lists.Lists doc = new SharePoint.Document_Lists.Lists();<br />
// SharePoint.Document_Lists is a web reference to http://.../_vti_bin/lists.asmx
<br />
doc.PreAuthenticate = true;<br />
doc.Credentials = System.Net.CredentialCache.DefaultCredentials;<br />
<br />
if (doc.CheckOutFile(oDocName.ToString(), oTrue.ToString(), mod_date))<br />
{<br /> process document here
<br />
}<br />
else<br />
{<br /> error message issued here
<br />
}
|
|
|
|
|
Hi all,
i have problem with UdpatePanel.My Application is Localised.we are using Multiple languages.and based on the selection the AjaxCalendarControl changes if i not use "Update Panel" if i use the Upate Panel then the calendar wont changes. Please help me. i have use the Update Panel and the CalendarControl should be changes to according the language selection.
Thanks in Advance..;)
Murali
|
|
|
|
|
Hi,
If the AjaxCalenderControl the UpdatePanel then we needs update contents in the updatepanel otherwise they are not updated after selection of language because u r language selection control outside the updatepanel try to put both controls in one place or AsynchronousPostbackTrigger
|
|
|
|
|
hi
i have a data list in my asp page and there is a label control in it
i'd like to show 2 values from my database (Views & ViewsAll columns) in its text property and i used this code:
<asp:Label ID="lblView" runat="server" Text='<%# Eval("Views,ViewsAll", "{0} ({1})") %>'> </asp:Label>
but an error happened
does anyone know wut did i do wrong?
thanks alot
|
|
|
|
|
What's the error ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Views,ViewsAll'
|
|
|
|
|
Well that helps. Those fields are not in your data source.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
how can i seperate them? i guess it thinks there must be a single column with this name "Views,ViewsAll"
i tried this one "'Views','ViewsAll'" but it also didnt work.
|
|
|
|
|
You can use two Eval statements
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i tried this one:
Text='<%# Eval("Views", "{0}") %><%# Eval("ViewsAll", " ({0})") %>'
but it also didnt worked!
how can i use 2 eval statements in here?
|
|
|
|
|
You can only have 1 databinding expression ( <%# xxx %> ) so you have to concatenate it thusly:
Text='<%# Eval("Views") + Eval("ViewsAll","({0})") %>'
or another way (which I personally prefer) is to let a code behing method deal with it:
Text='<%# FormatViews(Eval("Views"),Eval("ViewsAlL")) %>'
and then in code behind
protected string FormatViews(object views, object viewsAll)
{
return String.Format("{0} ({1})",views,viewsAll);
}
|
|
|
|
|
thank you so much i used first solution but the second one gave me a great hint to overcome some of my other problems!
|
|
|
|
|
Text='<%# Eval("Views", "{0}") Eval("ViewsAll", " ({0})") %>'
is what I would try. Have you not worked out that' it didn't work' is useless ? I need to know what happened, what went wrong ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thank you christian it worked fine also the other guy suggest a way to deal with it in code behind
thanks anyway, i learned a lot from you in this forum
|
|
|
|
|
There is aspx page where I am displaying a GridView with some data about basic details about a person.
In that GridView there is a hyperlink, which navigates to a new aspx page where I am displaying the detailed information about
particular person in some controls like text boxes etc.
I am getting all the data in the page when I write the code of displaying on Page_Load, but what I want is
when I click the hyperlink of Page "A" will navigate to Page"B" and the page gets displayed and no matter all the controls are loaded or not?
I want the page and some processing (something like AJAX update progress) gets shown till the controls load.
It means the page gets displayed first and after the retrieving of data the controls get loaded and till this processing somthing
like update progress gets displayed.
Do we have any event after Page_Load event?
Right now I am loading all controls at Page_Load event.
Thanks in advance,
|
|
|
|
|
salon wrote: Do we have any event after Page_Load event?
Yes, Page_Prerender, but that you even ask this, means you have no idea how ASP.NET works. Until the code in your codebehind has all run, NOTHINg is going to show on the client. You need to send a page which contains AJAX code which then loads the remaining controls, while showing your initial data.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
Im using vb.net (asp.net 2.0,sql server 2000) im transferring a excel sheet to a database table.the excel sheet contains 50,000 records , while on uploading 25,000 records were transferred unfortunately due to some problem system were shutdown, so when im again transferring the file excel sheet it should starts copying from 25,001 th record.how can i acheive this one..
regrds
Kanna
|
|
|
|
|
via ASP.NET ? You can't. A windows app, you could transfer via FTP and if the FTP server supported resume, you could.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
how to add value in datacontrol field add in grid view
|
|
|
|
|
How to find out keypress shift+f10 .Is there any keycode for it ?
Thanks
Archana
|
|
|
|
|
http://www.google.co.uk/search?hl=en&q=javascript+find+key+press&btnG=Google+Search&meta=
|
|
|
|
|
sorry ..I have already googled it..
but nothing related to Shift + f10 functionality..Tatz why I raised a question here...
Can you please help me ...
|
|
|
|
|
Hi,
How to Export Gridview to pdf in asp.net
I searched in many forums. but many of them said to use third party tools.
I don't want any third party tools.
Suggest me any sample for without using third party tool and export Gridview to pdf
The Below code is working, When I open the Pdf file the error is showing that " Adobe reader could not open test.pdf. because the file type hasbeen damaged"
How to Resolve this?
Thanks in advance
<br />
Dim FilePath As String = "c:\test.pdf"<br />
response.ContentType = "application/pdf"<br />
response.AddHeader("Content-Type", "application/pdf")<br />
response.AddHeader("Content-Disposition", "attachment; filename=" + FilePath)<br />
response.WriteFile(FilePath)<br />
response.end()<br />
|
|
|
|
|
Hi All,
I have created an Intranet application in which only the users of Active Directory has to log in.
In that I have given the authentication as "Forms" but when the user types in the URL, the web application has to get the logged in user and it has to be validated against the Active Directory, if the user is not valid then the page has to be redirected to the Login Page, else it has to go to the landing page.
I have tried with the steps in the link: http://msdn.microsoft.com/en-us/library/ms972958.aspx[^]
But I am unable to get it.
Is there any method available to get the logged in user through forms authentication?
Thanks a lot in advance.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
import java.net.*;
import java.io.*;
public class URLConnectionReader {
public static void main(String[] args) throws Exception {
String symbol = "SUNW";
URL yahoofin = new URL("http://finance.yahoo.com/d/quotes.csv?s="+symbol+"&f=sl1d1t1c1ohgv&e=.csv");
URLConnection yc = yahoofin.openConnection();
BufferedReader in = new BufferedReader(
new InputStreamReader(
yc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
}
how to convert this java code to .net with c#
pls help me
|
|
|
|