|
thnx a lot for ur reply.
I did all these steps then I opened the IIS and found the project and everything but when I write: http://localhost/<virtualdirectory>
the application cannot be accessed (Page cannot be displayed).
I want the other machine to access the application through the computer name.
like that: http://<computername>/<virtualdirectory>
|
|
|
|
|
You must define a default page, so when the application is requested its called,
you might also consider typing a virtual directory name.
|
|
|
|
|
Hi
After deploying the web appliction, Open Inetmgr, expand your web application and right click the default.aspx or default page, Click browse... then this will open your default browser. This is just for testing.
Now you will see the correct URL in the address bar (along with http://)..right??.
From next time you can type the URL directly in the address bar (i.e no need to go to Inetmgr again).
If you are getting some permission error, again right click the web appln (in inetmgr), go to Properties. Go to 3rd tab - 'Directory Security'. Click Edit.. Button. Uncheck Anonymous Access.
Click OK and refresh your web appln. Hope you are able to see your web appln
- Harini
|
|
|
|
|
Preven user to access previous page how i an i do that?
|
|
|
|
|
HI Nikhil
Please Modify your post no one is unable to understand what you want to ask ?
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Don't, period. This is very bad usability practice to force the user to do anything. Design your application better.
|
|
|
|
|
Prevent user to access previous page??
maybe. you may use javascript to clear the broswer history..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message. Thank you.
|
|
|
|
|
VS 2005, VB. I drop an AccessDataSource on the web page and click on
"Configure Data Source". If I used the browse button, the Access database
that is within the application path does not display. I moved the database
to other directories that the browse button is definitely showing, but it
does not display. If I ask it to show all files, I see other files in that
directory, but not the MDB. When I type the name of the MDB in manually, it
says that the file "does not exist or could not be mapped to a local file
that could be read". Access 2003 opens this MDB file and displays data from
it just fine, so the file can be read. I found nothing on this error
message using Google. Anyone know?
My small attempt...
|
|
|
|
|
I am having trouble finding out how to open a document in its native external program client side.
The application is a web based serverside .Net App(C#) that needs to open a file which exists on the server, but using a clients local program (eg notepad for .txt files). I have tried Process.start(), however, this only starts a server-side process which the client machine never sees.
I want to avoid using a hyperlink as I really need the files to be opened on a _SelectedIndexChanged event, and also creating a hyperlink to the servers local drive will not work for the clients. The scope for installing on client machines is basically nill so I seem to be somewhat stuck.
Please can someone help, as this is the whole point of the app and it will screw up my process if it can't be done
Thank you all in advance
Mark
|
|
|
|
|
If you stream the file to the client and put a bit in the header of the page as so:
Response.AppendHeader("content-disposition", "attachment;filename=<filename>")
Should open the file (as long as the user has the appropriate application.
|
|
|
|
|
Ok, that sounds good but...
I don't have the file name until the SelectedIndexChang event as it is calculated from the results of a grid view? would I have to pass the file name to a new page with the above Response.AppendHeader?
I'm afraid I'm new to .Net so may need some guidance here
Many thanks for your response, it has at least provided some light at the end of the tunnel.
|
|
|
|
|
That sounds about right to me.
|
|
|
|
|
Ok, I am redirecting to the new page having set the full filename (inc. path) as session.
ie.
String FullPath = "the path of my file on the server (not on the client machine)";
Session["FullFilePath"] = FullPath
Response.Redirect("OpenFile.aspx");
I am then in page load event of 'OpenFile.aspx' running:
Response.AppendHeader("content-disposition", "attachment;filename="+Sesion["FullFilePath"]);
However, it is just asking me to confirm that I want to open 'OpenFile.aspx', what am I missing?
I can at least see that this should work though so I am extremely grateful
Mark
|
|
|
|
|
Have you also opened the file and streamed it to the browser?
|
|
|
|
|
oops no,
do I do that on the new page? before appending the header?
I'm not sure i understand
|
|
|
|
|
You do that on the new page but don't stream it to the response until after you've added the header!
|
|
|
|
|
'Open filestream from your file
'Set your headers
Response.BinaryWrite(filestream.GetBuffer())
Response.Flush()
Response.Close()
output.Close()
output.Dispose()
|
|
|
|
|
ok, sorry been a while have been out the office,
whats the namespace for output? system..
sorry im a newbie and can't seem to find it
|
|
|
|
|
Apologies, that shouldn't have been output, that should be your filestream object... copy paste error...
|
|
|
|
|
ok that makes sense, whats the syntax for the binary write?
it wants an arguement of byte[] buffer do i ned to put in the max file size in the squares? and do i need buffer at the end?
thank you so much for yourhelp,
its digging me out of lots of c**p!
mark
|
|
|
|
|
OK , worked out the binarywrite bit,
compiled my site which was all fine
then got server error in my app.
'Specified argument was out of the range of valid values.
Paramater name: offset'?
but I can't see that anythings wrong?
my code so far:
FileStream theFile = File.Open(Session["FullFilePath"].ToString(), FileMode.Open);
Response.AppendHeader("content-disposition", "attachment;filename="+Session["FullFilePath"].ToString());
Response.Write(Session["FullFilePath"].ToString());
long filesize = theFile.Length;
byte[] getContent = new byte[filesize];
Response.BinaryWrite(getContent);
Response.Flush();
Response.Close();
theFile.Close();
theFile.Dispose();
any thoughts at all?
|
|
|
|
|
Hello.
I have a problem - and it's probably me not understanding the concept - but I want to programatically disable all controls in my aspx page - if the user watching the page is not authorized to edit the content.
Now this should be an easy task, so I've tried a couple of methods like looping through the page's Controls property and have all textboxes set their Enabled property to false. The following code does not work. I'm using a MasterPage, but I can't think of anything, that makes this a problem.
When I "ask" the MasterPage to print out the "count" for it's controls property it says there is about 5 items in the list. Although the page contains around 10 TextBoxes!
So what am I misunderstanding here?
Anyway here's the code:
foreach (Control c in Page.Controls)
{
switch (c.GetType().ToString())
{
case "System.Web.UI.WebControls.TextBox":
((TextBox)c).Enabled = false;
break;
case "System.Web.UI.WebControls.DropDownList":
((DropDownList)c).Enabled = false;
break;
case "System.Web.UI.WebControls.ImageButton":
((ImageButton)c).Enabled = false;
break;
default:
break;
}
}
I hope someone can help!
Thanks in advance.
Best Regards
Soeren
|
|
|
|
|
The easiest way to do is showing "50% transparency image" with higher z-order.
All you need to do is that you hav to create one gif image with transparency background. (file size should not be too big.) set the position of that image to absolute. and set the width and height of this image to 100%.. finally, set the zorder of image to highest value..(you may check out "LightBox" javascript toolkit.)
hopefully, you got my point.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message. Thank you.
|
|
|
|
|
Hi
I think better way for disabling fields is to write javascript function. I have added sample code below. Hope this helps.
'aspnetForm' - Form name of a web form
Example:
function DisableFields(vAccessRights)
{
//parameter - vAccessRights - to check access rights for particular user..
elm=document.aspnetForm.elements;
for(i=0; i < elm.length ; i++)
{
if(elm[i].type=="checkbox")
{
var chkboxId = elm[i].id;
//add code to enable / disable field
}
else if(elm[i].type=="textbox")
{
var txtboxId = elm[i].id;
//add code to enable / disable field here
}
}
}
- Harini
|
|
|
|
|
I had some what the same problem . Finally I had put the controls in a panel and do something like this
Dim ctrls As Control
For Each ctrls In Me.Panel1.Controls
If TypeOf ctrls Is TextBox Then
Dim tb As TextBox
tb = ctrls
tb.Text = DateTime.Today
tb.Enabled = False
(instead u can manipulate any property here)
End If
Next
|
|
|
|