|
Right, i like to instanciate the COM object (in my case iTunes) at the server side. you may think that does not make sense, but it does. is there any security restriction to do stuff like that?
regards, bernd
-- modified at 2:51 Thursday 28th September, 2006
i just noticed the error after changing the inpersonation is 0x80080005. seems to be a CO_E_SERVER_EXEC_FAILURE error, isn't it?
-- modified at 3:43 Thursday 28th September, 2006
in taskmanager i can see iTunes starts under the given user but no ui. i do not need the ui but if i start iTunes throu my code manually (not by iie) the ui will be shown. anyway, after one minute or so i get the 0x80080005 error.
|
|
|
|
|
Actually, I thought that you might have wanted to create the COM object at the client side.
Well, at the server side there are a couple of issues related to the security that you may need to take into account. Here are some for Office Automation, but it still can give you a couple of ideas.
http://support.microsoft.com/kb/257757/[^]
To check that, you can run the dcomcnfg.exe tool, then go to the Itunes application entry and check the security tab.
Another option (normally works in the case of Automation) is that you can create a seperate account, then use this account to logon to install the ITunes application, and finally configure to run the ASP.NET application under this account.
|
|
|
|
|
hey minhpc_bk,
thanks for your advice. you may read one post before my iTunes.exe starts but it does not displays any UI. i set iis process to allow "communication between service and desktop" but that does not change anything.
i checked out iTunes in dcomcnfg.exe and did the following steps:
authentificationlevel: None
launch and activation: <- added the executin user with maximum rights
access: <- added the executin user with maximum rights
configuration: <- added the executin user with maximum rights
And now i get a timeout after one minute. I can see in taskmanager iTunesexe is loaded but not more. The memory usage does dot change...always 23.816MB or 23.820MB but it does not change. Also the CPU usage is zero.
Maybe iis is now allowed to launch iTunes but iTunes is still not allowed to do anything..??
no idea...
|
|
|
|
|
Can you validate in the Task Manager and see if the ITunes runs under the impersonated account or the ASPNET account?
Here, you might want to spawn a new process at the server side and you can use the Process class. However, this class does not pass the impersonated token to the new process, and in this case you'll need to pinvoke CreateProcessAsUser function. For more information, you can see http://support.microsoft.com/default.aspx?scid=kb;EN-US;889251[^]
|
|
|
|
|
the process runs under the impersonated account. it does not matter if i start iTunes by System.Diagnostics.Process or by interop.iTunesLib. The behaviour is the same.
-- modified at 17:43 Thursday 28th September, 2006
Current state: i tryed to start calc.exe with the same result. i can see the process in task manager but no UI.
|
|
|
|
|
It seems to me that setting the "Allow service to interact with desktop" option of the IIS does not help in this case, as it does not have any effect on the ASPNET process and you are spawning ITunes in this process. So IMO you may consider writing a window service which is responsible for creating a new Itunes process, and from the ASP.NET application you can use Remoting (or Web Service) to send the request to the window service to have it start the Itunes.
|
|
|
|
|
I know that to write to the server, the ASP.NET user account needs write permission. But I'm trying to write to the server using regular ASP and need to know to what should I give write permissions?
/\ |_ E X E GG
|
|
|
|
|
Alex,
Normally, it's the IUSR_<IISServerName> (or IWAM_<IISServerName> ), more information can be found from here[^].
|
|
|
|
|
Here is the code from ASP.NET 1.1 that works. My problem is below with 2.0 GridView?
private void DataGrid1_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
int playerID = Convert.ToInt32(e.Item.Cells[1].Text);
string sqlDelete = "delete Players where PlayerID = '" + playerID +"'";
SqlConnection conn = new SqlConnection(dsn);
SqlCommand cmd = conn.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = sqlDelete;
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
DataGrid1.EditItemIndex = -1;
BindGrid();
}
This above code is ASP.NET 1.1 code for Deletion from DataGrid. It works fine. Now, I am using GridView (ASP.NET 2.0) The problem I am having is getting the playerID from GridView?
***int playerID = Convert.ToInt32(e.Item.Cells[1].Text); **
does not give any playerID but throws error? How do I get the playerID from GridView. Is the event handler Row Deleting or Row Deleted?
Please help.............
Sanjeev
|
|
|
|
|
I thought you set up the DataItemIndex on the grid to be a unique ID for that row.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi Christian,
Thank you for you reply. I am sorry but I did not understand the reply......
The issue is deleting any row from the grid when gridview is shown in the page.
I am trying to programmatically call the delete with code behind.
Thank you,
Sanjeev.
Sanjeev
|
|
|
|
|
A row on a gridview has the property I pointed out, it's purpose is to store a key that you can use to make a database call that identifies that row.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi
i am developing a portal using webparts.
i my design i use only one page(index.aspx) and load its content dynamically as webparts based on querystring.
assume that i have two webparts(webpart1, webpart2) in my application.
when the querystring is http://mysite.com/index.aspx?pageID=1
i should load webpart1 into page and when the querystring is http://mysite.com/index.aspx?pageID=2
i should load webpart2 into page.
when i edit each webpart's properties by switching to editmode of webpartmanager , the changes remain on the webpart until i close the browser and by openning new browser ond going to that page the webpart properties value show their default values not recent values.
what should i do?
|
|
|
|
|
I am building in some ajax functionality on my webpage, but I'm not using any frameworks (nor do I want to).
SO here's what I want to do. I'm trying to make a sort of edit-in-place thing on my site. So if you're signed in you can just click an "Edit" link and then it will show a page w/ a textarea and a save button. I have all this done already.
If I was on the products.html page when I clicked "Edit" I want to pass "products.html" back to the server and have the server send back to me the source of the products.html page - as it is on the server. I want to do this asp.net/C# on the server, can I do this? I want to call a function in a aspx.cs file asynchronously.
SO then, the server will come back with the source of the products page and I will fill the text area with that. Then the user can edit the source and then click the save button. This will send the source back to the aspx.cs method, which will physically save it to the server.
So, how can I call a asp.net method asynchronously with javascript/ajax?
/\ |_ E X E GG
|
|
|
|
|
|
We've developed a web app that uses .net 2.0. My boss wants us to create a flash context-sensitive help system using robohelp X5. I've created some test help files (okay, "some" is not the right word - robohelp created 154 files for this - and only three of those files were actual content pages).
In any case, I put the following line in the master page:
<link rel="text/javascript" href="bin/FlashHelp/RoboHelp_CSH.js" /><br />
and then I put this code in for the help link:
[a class=\"HLinksFont\" href=\"javascript:RH_ShowHelp(0, './bin/FlashHelp/john_test_flash_01.htm', HH_HELP_CONTEXT, 1);\"]HELP [/a]
(I had to replace the pointy brackets with square ones so the oce would display - so much for the code tag, eh?)
Items of note:
1) The indicated js file is in the directory shown above.
2) I didn't misspell anything in the link tag
3) The function I'm claling in the second code snippet exists in the js file I'm linking to.
Result - IE tells me that an object is expected at line/char 1 in default.aspx. What am I doing wrong?
[EDIT]
RESOLUTION
It seems that you can't put files into the bin folder and access them from the web page. When I moved the folder containing the help files into the page root folder (and modified the vraious path specifications in the web page files), everything worked as expected.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
i want some help with exporting detailsview to excell.I m working on a web application and i have a search page and a result page.The result page demonstrates the results of the search in a detailsview and i want to export it to excell.I use a button for that, the code of the button is :
protected void Button1_Click(object sender, EventArgs e)
{
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.Charset = "";
// If you want the option to open the Excel file without saving then
// comment out the line below
//Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
DetailsView1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
}
public override void VerifyRenderingInServerForm(Control control)
{
/* Confirms that an HtmlForm control is rendered for the specified ASP.NET
server control at run time. */
}
But i have an error message :
"RegisterForEventValidation can only be called during Render();
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.InvalidOperationException: RegisterForEventValidation can only be called during Render();"
Any ideas?????It's very important
Thanks galatia
galatia
|
|
|
|
|
|
I am building a site (using Visual Web Developer and C#) that uses master pages to display content pages (defined in .aspx files) in defined contentplaceholders.
One master page displays either content page A or B. I would like to develop a second master page that displays both A and B in separate ContentPlaceHolders.
How do I link an aspx content page to contentplaceholders in more than one master page?
Any help appreciated!
Jell
|
|
|
|
|
I believe you have the concept reversed. You don't assign content pages to master pages but rather assign a master page to content pages.
only two letters away from being an asset
|
|
|
|
|
Mark,
Thanks for your reply.
You are are right, every content page has to say which master page (and which placeholder(s)) it is assigned to, but that is the root of the problem.
The assignment is done within the content page (using MasterPageFile=xxx in the page directive), and you can only specify one master page. So if I want to use the same content page in different master pages then I am stuck, as this would require two master page assignments in the page directive.
I appreciate that I could copy all the content page code into a separate file, with a different master page assignment, but that seems inelegant and prone to errors.
Jell
Jell
|
|
|
|
|
You don't.
Make the content pages into user controls, and create two sets of content pages that displays the user controls.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa,
This was the answer I needed - works a treat!
Thanks for your help.
Jell
Jell
|
|
|
|
|
Hey guys I have to get the basics of asp using vb.net within the next 3 days...I should be able to do it...I have learned 12+ languages, and I already know VB.Net...Im just having some trouble with designing the forms, How do I place controls where I want them? If you have any sugestions please let me know.
Thank You!
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
When you are looking at your website in the designer (the .aspx not the .aspx.vb) you can look at either the design or the source. You can toggle between the two views by clicking on either "design" or "source" at the bottom left of the screen. The source view shows the html of the page. You will want to use html to create tables to oranize your controls on the page.
Here are some sites that might help you with html:
The Bare Bones Guide to HTML[^]
Tables in HTML Documents[^]
HTML Tag Quick Reference[^]
|
|
|
|