|
Hey all,
Im still fairly jr to the whole development thing and I'm having an issue with double hop impersonation.
Unfortunately, kerberos is not running on our network and from what I have read this is what is stopping me from doing what I need to do.
What my code is doing is calling a WCF proxy service and getting member data and then using that to get items from SharePoint using the Lists.GetListItems() SharePoint web service.
I am able to get my member data from WCF proxy but when I call the GetListItems() I get the 401 because impersonation is not working.
- Impersonation is "true" in web.config
- Authentication mode is set to "Windows" in web.config
- I have set the WindowsIdentity
I CANNOT manually enter the credentials and HAVE to use impersonation.
Possible?
XmlDocument xmlDoc = new System.Xml.XmlDocument();
XmlNode query = xmlDoc.CreateNode(XmlNodeType.Element, "Query", "");
XmlNode viewFields = xmlDoc.CreateNode(XmlNodeType.Element, "ViewFields", "");
XmlNode queryOptions = xmlDoc.CreateNode(XmlNodeType.Element, "QueryOptions", "");
string listName = "{89ddecff-9716-4b4f-ac64-3e7f3491fc05}";
string viewName = "{69326313-a982-41d3-be58-7ce7c06b5693}";
string rowLimit = "150";
queryOptions.InnerXml = "<includemandatorycolumns>FALSE<dateinutc>TRUE";
viewFields.InnerXml = EcmQuery.GetViewFields();
query.InnerXml = EcmQuery.GetQuery(rowno);
System.Security.Principal.WindowsIdentity wId = (System.Security.Principal.WindowsIdentity)HttpContext.Current.User.Identity;
System.Security.Principal.WindowsImpersonationContext ctx = null;
ctx = wId.Impersonate();
ListsWebReference.Lists list = new ListsWebReference.Lists();
list.Credentials = System.Net.CredentialCache.DefaultCredentials;
XmlNode items = list.GetListItems(listName, viewName, query, viewFields, rowLimit, queryOptions, null);
Thanks in advance for ANY help!!!!!
|
|
|
|
|
I am adding some new pages to an existing C# asp.net 2010 web forms website. Due that that fact and I am new to web design but how desktop expereince, I have the following question:
On the exsiting web pages, most of the controls are embedded in a web table control. I am guesing this is occuring so all the web form controls are aligned correctly. Is that the only way to make the various controls line on correctly? If not, can you tell me another way how to make the controls all line up the same. (I do know when I worked with pure HMTL in year 2000, all the HTML controls were embedded within the same table
|
|
|
|
|
In the past using tables for alignment was the only method available. Now, however, CSS is being used for tableless design.
This is one place to start but there are many more resources available
Tableless layout HOWTO[^]
No comment
|
|
|
|
|
for alignment take a look at http://960.gs/ or even better if you are interested in using jQuery and want an adaptive display you can read about the following about an awesome jQuery plugin that this really great developer I know posted.
A jQuery plugin for an Adaptive 960 Grid System
who better the shamelessly promote other than yourself?
|
|
|
|
|
Hi,
Nowadays to get a best web page layout that is not only easy to render on client side but also easier to design, is to actually avoid tables and use something like divs (or ). This element can align your entire page like magic! As you can see in my example i have put in place a simple but yet handy attribute to the div, "style". The style attribute will help you style your div (oh div stands for "division", a division on your page), and for the sake of alignment in my example i have put float:left, you could also have float:right or simply don't put the float and the browser will decide where to place your division(s) when rendered. There are many styles you can put such as margin, padding, text-align, background, color....and much more!
This comes with the power and magic of CSS! Get a hard start on this topic, css:
http://www.csstutorial.net/[^]
This all you need to giveup tables on your pages.
Happy coding,
Morgs
|
|
|
|
|
I face this error when I click on button ,Linkbutton or datalist item command.
I change
<page enableEventValidation="false"> in web config file.This erropr is reomved but now event does not occurs.
Please help me.
the complete Error is
The state information is invalid for this page and might be corrupted.
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.Web.HttpException: The state information is invalid for this page and might be corrupted.
Source Error:
[No relevant source lines]
Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\portal9161new\1f521660\5181c4db\App_Web_mryexrix.10.cs Line: 0
Stack Trace:
[FormatException: Invalid character in a Base-64 string.]
System.Convert.FromBase64String(String s) +0
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +72
System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4
System.Web.UI.ClientScriptManager.EnsureEventValidationFieldLoaded() +57
[ViewStateException: Invalid viewstate.
Client IP: 127.0.0.1
Port:
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MSN Optimized;US)
ViewState: /wEWFwLO08XUCALz3vPHCwKzrv6wAwK9vJ38DAKpi4ufBQKIgpWfBQLrmZefBQLKkICfBQK98JOfBQKc5/2WBQL//veWBQLe9YifBQLj4JT2BwLUk/WqAgKOkrn2CAKLkrn2CALCvJnnBAK//ZjtBwLNzIK2CALsjZ7JCALgutCTDwKLlba1BgLBzqW+BXf/jiRHAjSf0ntN+9hIlN0OfE3b,/wEWEQKIr8XKBALE5ML0AgLl97ftDQLb44SECwLb4+iFCwLR5JWQCwKBp/mABQL3meq7DgLqwoebCwL14vPbCQKe5MqPCQKNo6XnBAKe8IG6DAKipuWCDAK33sGJAQK33rWJAQLk97ftDfQ62Og2DDwFHqA1OfwvN70aZODt
Referer: http://localhost:4424/Portal9161new/seatingplan.aspx
Path: /Portal9161new/seatingplan.aspx]
modified 12-Oct-11 5:06am.
|
|
|
|
|
Hi,
I want to disable the checkbox if the gridview cell 4 has KS value and if the 3 cell has value less than 5.
Getting object reference not set in gv=Gridview1.SelectedRow
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
GridViewRow gv ;
gv =GridView1.SelectedRow;
if (gv.Cells[4].Text == "KS" || gv.Cells[5].Text<=5)
{
if (gv.RowType == DataControlRowType.DataRow)
{
CheckBox chkDelete = (CheckBox)gv.Cells[0].Controls[0];
chkDelete.Enabled = false;
}
}
}
Need help
Thanks
S.Guhananth
|
|
|
|
|
Try Following Code
protected void grdiwo_With_Serial_no_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (!(e.Row.Cells[8].Text == "KS"))
{
CheckBox chkDelete = (CheckBox)gv.Cells[0].Controls[0];
chkDelete.Enabled = false;
}
}
}
|
|
|
|
|
I think you should replace the line:
gv =GridView1.SelectedRow;
with
gv = e.Row;
you should make sure it is a DataRow before trying to enter the cells:
if (gv.RowType == DataControlRowType.DataRow)
Also, you should parse the text in gv.Cells[5] to integer or double like:
int.Parse(gv.Cells[5].Text)<=5
the code will be
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
GridViewRow gv ;
gv =e.Row;
if (gv.RowType == DataControlRowType.DataRow)
{
if (gv.Cells[4].Text == "KS" || int.Parse(gv.Cells[5].Text)<=5)
{
CheckBox chkDelete = (CheckBox)gv.Cells[0].Controls[0];
chkDelete.Enabled = false;
}
}
}
Good Luck
Help people,so poeple can help you.
|
|
|
|
|
I am having trouble accessing the ajax control toolkit that I installed on my visual studio.net 2010 professional ide.
I followed the directions that are listed on the following link: http://www.asp.net/ajaxlibrary/act.ashx.
I setup a new C# website and had the default.apx file open. I was then able to see the ajax toolkit controls from the NEW website I setup.
However now for an existing C#. asp web form 2010 application, I am adding a new page webpage and I want to use the ajax controls I just added to my ide. However, when I click on the toolbox, I do NOT see the ajax control toolkit I just added to the my visual studio ide from this existing project.
However when I go back to the new web application I just setup, I DO see the ajax control toolkit.
Thus I can see the AJAX Control Toolkit on the toolbox when I open the 'new' website project. However, I do not see AJAX Control Toolkit on the toolbox when I open my existing application.
Thus, can you tell me how I can access the AJAX Control Toolkit from the tooltox for my existing application?
|
|
|
|
|
I want to use some add a few page to an existing C#.net 2010 webforms application. I want to use the same master pages that the entire site uses. Thus to add new pages pages to the with the same master pages, i would like a reference on how to accomplish this task and/or directions on how to accomplish this task
|
|
|
|
|
Hi guys
I come with a problem while i am working with my site, programme ASP.NET4.0 with url routing.
one of the siteMapNode in Web.sitemap is <sitemapnode url="/home" title="Home" description="Home Page">,
the SiteMapPath(navigation, bind with Web.sitemap) display well when i visit http://localhost/home,
but it does NOT display at all while I add a slash("/") at the url's end(url looks like http://localhost/home/)
ps:the other infomation well displayed on both urls, just the SiteMapPath problem.
does someone run into it too? hope your guys can give me a hand, thank you.
modified 16-Oct-11 10:12am.
|
|
|
|
|
please reply. thank you!
|
|
|
|
|
What do you want to download? a pdf, doc, xcel, or image file?
Please explain further! To allow users to for instance download a pdf file all you do is:
<a href="/downloads/file1.pdf" target="_blank" title="Click here to download this pdf file">Download File</a>
Whenever a user clicks on this anchor, the browser will open the download window and depending on browser type some will open the file for you and some will ask the user to download.
Happy coding,
Morgs
|
|
|
|
|
If you expect any sort of decent answer you need to provide more details. Simply using the subject line to ask the question isn't enough here.
No comment
|
|
|
|
|
hi friends
i am using visual web developer 2010 express
i have a master page and a many content pages. i set one of the page(welcome.aspx)as start up page by right clicking on it and choosing the set as start up page.
but after i run the application for some times it says that it is not connected to local host welcome.aspx so again if it set is as start up page by doing the above process it works.
so how to fix it...i cannot always go and click it and set it as set as start up page...
K.Gayathri
|
|
|
|
|
Go to WebProject property->Web-> Configure there your specific page OR Start URL
Parwej Ahamad
|
|
|
|
|
hi
thanks for the reply
i went into the path what you said and i found out that the specific page was already given correctly but also still i am having the problem.....
sometimes it comes correctly sometimes it doesn't...
K.Gayathri
|
|
|
|
|
Are you using internal Visual Studio IIS?
Parwej Ahamad
|
|
|
|
|
|
Go to Project Property -> Web -> Start URL:
http://localhost:xxxx/default.aspx
Note: xxxx is port no. When you run the application you will see port no that IIS used.
Thanks
Parwej Ahamad
|
|
|
|
|
Hi,
Below error is displayed when i read excel file using oledb4.0. The code is working well for other applications on same server.
System.InvalidOperationException: The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine. at System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionString constr, DataSourceWrapper& datasrcWrapper) at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.OleDb.OleDbConnection.Open() at UploadExcelFile.SaveXlsFileCols(Int32 int_FileId, String str_filePath, String str_extension, String str_fileName)
Though same code is running for other application on same server.
protected void SaveXlsFileCols(int int_FileId, string str_filePath, string str_extension, string str_fileName)
{
string connString = string.Empty;
if (str_extension == "xls")
{
connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + str_filePath + ";Extended Properties=\"Excel 8.0;\"";
}
else
{
connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + str_filePath + ";Extended Properties=\"Excel 12.0;\"";
}
// Create the connection object
using (OleDbConnection oledbConn = new OleDbConnection(connString))
{
try
{
if (oledbConn.State == ConnectionState.Open)
{
oledbConn.Close();
}
// Open connection
oledbConn.Open();
DataTable dbSchema = oledbConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
string WorkSheetName = dbSchema.Rows[0]["TABLE_NAME"].ToString();
// Create OleDbCommand object and select data from worksheet Sheet1
OleDbCommand cmd = new OleDbCommand("SELECT * FROM ["+WorkSheetName+"]", oledbConn);
|
|
|
|
|
do you have Microsoft Access installed on the host on which the application is running?
Help people,so poeple can help you.
|
|
|
|
|
Hi,
Im using datepicker using standalone jquery. The datepicker works perfectly in WebForm. Now i decided to use a site master on my sample project and I add some web content form also inside the site.master.
In my web content form i add search function with date range.
Now, the problem was, after using web content form, datepicker no longer showing the icon "..." beside my asp:textbox.
Please see below tags in my site.Master page.
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Path="~/scripts/datepickerjs/jquery-1.3.1.min.js" />
<asp:ScriptReference Path="~/scripts/datepickerjs/jquery-ui-1.7.1.custom.min.js" />
<asp:ScriptReference Path="~/scripts/datepickerjs/daterangepicker.jQuery.js" />
</Scripts>
</asp:ScriptManager>
i also place the css in site.master inside the head tag.
<link rel="Stylesheet" type="text/css" href="style/datepickercss/ui.daterangepicker.css" />
<link rel="Stylesheet" type="text/css" href="style/datepickercss/redmond/jquery-ui-1.7.1.custom.css" title="ui-theme" />
In my web content form i place the script after the asp:Content tag.
<script type="text/jscript">
$(function() {
$("#txtDateFrom").datepicker({
changeMonth: true,
changeYear: true,
buttonText: 'Select Date From',
buttonImage: 'images/calendar.gif',
buttonImageOnly: true,
showOn: 'button'
});
});
$(function() {
$("#txtDateTo").datepicker({
changeMonth: true,
changeYear: true,
buttonText: 'Select Date To',
buttonImage: 'images/calendar.gif',
buttonImageOnly: true,
showOn: 'button'
});
});
</script>
Finally, when i run my project the "..." is not showing. Normally, when i used web form this "..." will show and i can select a date, but now after switching to web content form, "..." is no longer visible.
Thanks
if(you type your code here) {
Messagebox.Show("You help me a lot!");
}
else {
You help me = null;
}
|
|
|
|
|
klaydze wrote: $("#txtDateFrom").datepicker({
Using a MasterPage will change the id. You may want to try
$("[id$='txtDateFrom']").
to get the id that ends in txtDateFrom
[Edit for correct punctuation]
|
|
|
|