|
Hi to all
I create a new product using asp.net,c#,sql server.
Using this product the user can create own .aspx files. Now my question is after creating the page the user need to save this in sub domain, my product is in main domain sub directory is this possible to save the file in sub domain from main domain ? If yes then please members guide me with source code ....
|
|
|
|
|
I have an image control (ASP.net 2.0) that won't show the image at runtime. it's set to runat = server. I'm using the development server in VS. It shows fine on the page at development time. It shows the alternate text where the image should show. the image is in my ~/App_Data/ folder & is a .jpg.
|
|
|
|
|
have u tried showing image from any other folder?
Ashish Sehajpal
|
|
|
|
|
Ashish,
thanks for the reply. It seems that loading it from the root "~/" works . But, from the "~/app_code/" or "~/app_data/" folder doesn't. go figure! Any idea why?
thanks,
bld
|
|
|
|
|
dear... as per architecture of dot net, app_code or app_data folder do not have permissions to be accessed like this way...they are meant ot store system resource and will be compiled to a DLL file...
how come we compile any image file?
always try to keep images resources into a folder named images... it helps building more sophisticated solutions and increaes readability from developers.
cheers !
Ashish Sehajpal
|
|
|
|
|
that makes sense...thanks again!
|
|
|
|
|
Hi all,
I'm running into a problem on a web service I'm writing. I'm getting a "The underlying connection was closed: Could not establish trust relationship with remote server." message when a test page I wrote try to consume a web service I wrote. The web service uses SSL and I generated a test license using MakeCert.
I've googled the problem and I've tried the suggested solutions (checking DNS name of my machine vs the one on the license). The code "solution" (more like a hack) on MSDN works for me when I added the code segment into the test page, but that just weakens the security aspect of it (plus the web service is suppose to be consumed by 3rd parties and I don't really want to tell them to do such a hack.)
Can somebody help me or point me in the right direction?
|
|
|
|
|
Hmm, just realize somebody asked the same question in a previous thread (with an undescriptive subjet of 'Question'). But the answers there doesn't really help me. So please, if anybody can help me, it'll be greatly appreciated.
|
|
|
|
|
Bleh, figured it out. Needed to generate the certificate against our internal trusted certificate provider.
|
|
|
|
|
Hey, i just moved to a new webserver running win 2k3 and IIS 6.0. on my last webserver(it died) we were able to let the web application run executables from code Process.Start(blah) that were typically in their own directory under c:. they were just file converters that took .wav(user likes) and made them .ul(we like) and a TTS app that we wrote. with IIS 6.0 even with the accounts(IUSR, IWAM, etc..)having full access to the directories we get a Access Denied exception when the web app tries to run the programs. We have little experience with windows 2k3 server and IIS 6.0 the last server was win 2k with IIS 5. i've been looking on google for a while but cant find a solution that works.
any help is appreciated.
|
|
|
|
|
Do you know what resource is being denied? Checkout FileMon or RegMon by SysInternals (now owned by MS). Together they have helped me solve many a permissions issue. It can help you determine both the resource and the user account being used to access that resource. From there you should be able to determine the access required.
|
|
|
|
|
9:25:24 AM aspnet_wp.exe:2256 OPEN C:\sox\ SUCCESS Options: Open Directory Access: 00100001
9:25:24 AM aspnet_wp.exe:2256 DIRECTORY C:\sox\ NO SUCH FILE FileBothDirectoryInformation: sox.exe "*
9:25:24 AM aspnet_wp.exe:2256 CLOSE C:\sox\ SUCCESS
9:25:24 AM aspnet_wp.exe:2256 OPEN C:\ SUCCESS Options: Open Directory Access: 00100001
9:25:24 AM aspnet_wp.exe:2256 DIRECTORY C:\ SUCCESS FileBothDirectoryInformation: sox
9:25:24 AM aspnet_wp.exe:2256 CLOSE C:\ SUCCESS
9:25:24 AM aspnet_wp.exe:2256 OPEN C:\sox\ SUCCESS Options: Open Directory Access: 00100001
9:25:24 AM aspnet_wp.exe:2256 DIRECTORY C:\sox\ SUCCESS FileBothDirectoryInformation: sox.exe
9:25:24 AM aspnet_wp.exe:2256 CLOSE C:\sox\ SUCCESS
it simply says no such file when it tries to access a file i know is there. the aspnet account has full control in that directory. this is from my local machine that has the same problem, but is win xp with iis 5.1 the code ran perfectly on a win2k box with iis 5.0.
Could running the application pool with the Local Service account cause a problem in our production environment?
|
|
|
|
|
running as local service is generally descouraged since it grants full access priviledges if IIS is compromised. Why, does everything work if you're running as local service?
Also, I didn't see any access denied errors in your FileMon output there, have you looked at RegMon? Maybe the process is trying to access the registry and being denied access.
|
|
|
|
|
I checked and everything's running as a Network Service. i was told the other settings have been tried but none work, and inputting a username and password caused IIS to say the site was unavailable.
here's the only access denied entries i found in regmon after i tried to execute sox.exe from our web app.
26.33727455 aspnet_wp.exe:2256 OpenKey HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer ACCESS DENIED Access: 0x1 DEVELOPMENT2\IUSR_DEVELOPMENT2
...there were a bunch in here, a few not founds and no more entries...
26.33812141 aspnet_wp.exe:2256 OpenKey HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\ ACCESS DENIED Access: 0x20019 DEVELOPMENT2\IUSR_DEVELOPMENT2
26.33816528 aspnet_wp.exe:2256 OpenKey HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\ ACCESS DENIED Access: 0x20019 DEVELOPMENT2\IUSR_DEVELOPMENT2
and no access denied errors in filemon. and again these are on my local machine with win xp and iis 5.1..i'm going to try to run these on the production server, but i'm not sure how that will turn out.
|
|
|
|
|
If you try to use a specific user account you will need to grant the proper access to that account. Namely, access to asp.net temp directory in the framework directory (c:\windows\microsoft.net\framework\vx.xxx\Temporary ASP.NET Files). Also your application directories and any other resources used by the application, including registry keys. Granting access to the asp.net temp directory and assigning the account to the IIS_WPG should cover the basic stuff and then you'll just need to make sure your application settings are correct. Here's an article on IIS_WPG[^] Otherwise, your site won't work as you have already discovered.
Have you tried using Local System to see if that corrects the problem? If it does you could compare the errors you're getting with success entries to see where the difference is and track down the issue that way.
|
|
|
|
|
|
Thanks for the info, we have another solution we're going to try to see if it helps, if we stop and start that IIS Admin service i assume it'll stop and start all of the websites correct?
We currently use Process.Start, i think we're going to try declaring a Process object and a ProcessInfo(not sure of the exact name) object and settings createnowindow = true and shellexecute= false, it works for us other places, mainly in applications where we dont want the screen to flicker when it uses the same application. if you can think of a reason this wouldnt help please let me know. I do appreciate all your help so far.
|
|
|
|
|
Yes, restarting IISAdmin restarts all web sites as well as their corresponding application pools.
It should certainly help, let us know if your solution works for the benefit of others who experience the same issues.
|
|
|
|
|
I always try to, my boss is currently writing a util class to run this app so we only have to change it in one place (the orig dev on this site wasnt very forward thinking). I'll let you know how we manage to fixit. I get to go play with VS2008 now.
|
|
|
|
|
I tried the Interact with Desktop checkbox, and restarted the services, but i'm still getting the same problem..we havnt had time to try the other method of starting the process, any other ideas...i'm giving the IUSR account and some others access to the directory that contains the program but i dont know if that will help with 2003, it did with 2000
|
|
|
|
|
We were running the App pool with Network Service set, we needed to create another app pool (someone changed the user under the "Configurable" selection so we didnt have the corect Password for the IWAM_<servername> account), in the new app pool we set the identity to configurable which was prepopulated with the IWAM_<servername> account, and gave the IIS_WPG group write access to the directory the files are created in, and everything worked...We also have the Interact with desktop option on for the IIS Admin service, we're going to try turning that off tonite. Hope this helps someone, feel free to contact me if you have any questions, Thanks for your help Mark.
|
|
|
|
|
I have a gridview inside which I have added a linkbutton the gridview will be binded from codebehind from two different tables(one at a time i.e if search parameter is category it will be binded from categorytable and if search parametre is item it will be binded from item table). Now what I want to do is to add OnCommand="mycommand" from codebeinh and CommandArgument from codebehind to the event oncommand. How can I do this. Please help me.Any help will be highly appreciated
<table>
<tr>
<td>
<asp:GridView ID="gridviewsearchresult" runat="server" OnRowDataBound="gridviewsearchresult_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="linbutton" runat="server" ></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
<tr>
<td>
<asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton></td>
</tr>
</table>
Codebehind:
protected void gridviewsearchresult_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//Am I correct cant work here
LinkButton lnk1 = (LinkButton)e.Row.FindControl("linbutton");
lnk1.Click +=new System.Web.UI.WebControls.CommandEventHandler(OnLinkClick);
}
}
|
|
|
|
|
why to make this process that much complex....?
you better do as following:-
1.
try to get the command argument field with common name from both tables...
(using alias in select query).
e.g.
select catid, catname, cast(catid as varchar(10)) + ':CAT' as commandID from tblcategory
where searchtext=@searchtext
select itemid, itemname, cast(itemid as varchar(10)) + ':ITEM' as commandID from tblitems
where searchtext=@searchtext
2.
assign the function name & command argument at design time.
e.g
<asp:LinkButton ID="linbutton"
runat="server" commandname='cn'
commandargument='commandID' ></asp:LinkButton>
3.
in the code-behind, check for commandargument,
split it and check for CAT or ITEM and then do the needfull.
cheers !
Ashish Sehajpal
|
|
|
|
|
Well thank you very much i will give it a try
|
|
|
|
|
Thank you once again that was a wonderful this is my first asp.net so didnt have much idea on query
|
|
|
|