|
So, your app is not going to be used on the internet ? You can put the path on the URL, or store it in the session.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
The application is run in localhost. How do you store it in session? And will that work if more than one instance of the application is running at the same time?
|
|
|
|
|
This is what I have so far. Perhaps this can help you see what I am doing/intending to do:
Form1.aspx.cs
public void button_Click(object sender, EventArgs e)
{
string dt= string.Format("Text{0:yyyy-MM-dd_hh-mm-ss}.txt", DateTime.Now);
StreamWriter sw;
sw= File.CreateText(@"C:\Documents and Settings\user\Desktop\Request\" +dt);
sw. WriteLine("This is the first line");
sw.Close();
string filepath = @"C:\Documents and Settings\user\Desktop\Request\" +dt;
FileInfo file = new FileInfo(filepath);
string filename= Path.GetFileName(filepath);
}
Form2.aspx.cs
public void Timer1_Tick(object sender, EventArgs e)
{
FileStream file = new FileStream (filename, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
StreamReader sr = new StreamReader(file);
string s= null;
while ((s= sr.ReadLine()) != null)
{
if (s.IndexOf("Current Statue: ") != -1)
{
lblStatus.Text = s;
break;
}
}
sr.Close();
}
Because the text file is a log file, I need to continuously monitor it as it is being updated. Hence, I've placed it inside an UpdateControl and set it inside the timer so that every time the timer goes off, the file is looked into.
The error I'm encountering is that the "filename" is not being recognized in the second form.
Thanks
|
|
|
|
|
Hi Guys,
I'm developing on vista in .net 3.5 and have created a VirtualPathProvider that works under Cassini but not on IIS. I'm attempting to debug this by using a custom HttpProvider but this doesn't appear to be working either.
I am developing on Vista (argh!), and my config file contains the following:
<httpHandlers>
<remove verb="*" path="*.gif"/>
<add verb="*" path="*.gif" type="CTC.Code.MediaHttpHandler"/>
<remove verb="*" path="*.wmv"/>
<add verb="*" path="*.wmv" type="CTC.Code.MediaHttpHandler"/>
</httpHandlers>
But still when debugging on local IIS, it never hits the MediaHttpHandler, or the VirtualPathProvider. In Cassini they both work fine.
I'm really at a loss about this. Does anyone have any thoughts?
Regards
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
modified on Tuesday, January 20, 2009 11:41 AM
|
|
|
|
|
Does it work during debugging..? Means with Webservice provided with ASP.NET debugger
Abhishek Sur
|
|
|
|
|
Well, In vista (IIS7) needs to be configured to recognize the HTTP handler. I have blogged it here[^]. Hope it helps
|
|
|
|
|
I'm using a static property to pass a shared int value, however, code is breaking when setting the property value.
Any idea why?
public partial class TaskEntry : System.Web.UI.Page
{
...
Global.TaskCategory = 0;
Response.Redirect("TaskEntry.aspx");
...
}
public class Global
{
public static int TaskCategory {
get { return TaskCategory; }
set { TaskCategory = value; }
}
}
Error:
An unhandled exception 'system.stackoverflowexception' occurred.
Jon
|
|
|
|
|
erm....
jon_80 wrote: public static int TaskCategory {
get { return TaskCategory; }
set { TaskCategory = value; } //breaks here!
}
a property lets you write code that stores the actual value. Because the value you set, is the property, this code calls itself. If you use a property, you can, in .NEt 3.0, create it without creating a variable to store the actual value, but if you want to write the code, as you have here, you need to create a variable, such as static int _taskCategory. and then set that value in your property.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
dear Experts,
How to Play vedio in Asp.net?and how to find time of play for the video?
I am used <object>.
with this i can not find the time of the video played and length of the video.
plz help me to do this.
Thank in advance
|
|
|
|
|
ASP.NEt cannot play video, anyhow, all you can do, is embed code in the page ( which is just HTML, there's no ASP.NET component involved ) to use media player to play the video. Thingsl ike the time played, also cannot be done in ASP.NET, they need to be done in javascript, if the component supports them.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello
Using ms access database i build a application
locally this application is working fine
when i uploaded this application its giving error..
Error as fallows
"Server Error in '/' Application.
Internal .Net Framework Data Provider error 12.
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: Internal .Net Framework Data Provider error 12.
"
While i am using simple code as fallows...
If cat <> Nothing Then
strSql = "SELECT * From logos where category like '" & cat.Replace("'", "''") & sstr & "' order by category"
Else
strSql = "SELECT * From logos order by category"
End If
Dim da As New OleDbDataAdapter(strSql, Conn.myconn)
Dim ds As New DataSet()
If Not Page.IsPostBack() Then
da.Fill(ds)
lblRecordCount.Text = CStr(ds.Tables(0).Rows.Count)
ds = Nothing
ds = New DataSet()
End If
da.Fill(ds, CInt(lblCurrentIndex.Text), CInt(lblPageSize.Text), "logos")
if any one knows plz help me
thanks in advanced..
krishna veer singh
|
|
|
|
|
Your code does not show us where you create myconn That is where the Problem is Show us a code where you declare your connection Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi,
I have nested Iframes.
PageA has Iframe 1
Iframe 1 contains Page B with Iframe 2
Iframe 2 contains Page C.
On Page C ,when a button is clicked . I need to pass few values to Page B and populate the labes there on Page B. In my Java script when I try to get the top.document it always returns Page A.
What javascript code can I use to get hold of my second page (page B) from my third Iframe after a button click on it?
regards
vj
|
|
|
|
|
Hi There,
I want to pass page as paramaeter to function which I had written in javascript in seperate js file.I was doing like below.
lnkAddCity.Attributes.Add
("OnClick", "ActivateCountry(" + this.Page + "," + lnkAddCity + ")");
lnkAddCity this is my button name and I had written this code in page load event.
Can any body able to tell me how to do this.
Thanks.
|
|
|
|
|
ais07 wrote: ("OnClick", "ActivateCountry(" + this.Page + "," + lnkAddCity + ")");
First you need to understand what you can pass using JavaScript and what not
Do
You can only pass string values from
one function to another
one page to another
Don't
You cannot pass any object using JavaScripts
You can save object in session and then access it on another page.
|
|
|
|
|
Thanks For Reply
I had done this before but by passing page in HTML code of my webpage.
|
|
|
|
|
ais07 wrote: önsubmit="ActivateCountry(this);"
You are passing javascript object to a javascript function.
But you cannot pass a javascript object to ASP.net
and reverse is also not true
|
|
|
|
|
That's not correct, you can pass javascript objects in javascript functions. I think you might be getting confused with trying to pass the ASP.net Page object to a javascript function (which indeed, you cannot do).
|
|
|
|
|
I mean, you cannot pass objects between javascript and asp.net
but one can pass objects between javascript functions.
|
|
|
|
|
You can't do it like that, as you're trying to pass an asp.net object to JS. You can do it like you had it in your reply below:
lnkAddCity.Attributes.Add
("OnClick", "ActivateCountry(this," + lnkAddCity + ")");
|
|
|
|
|
Thanks For Reply,
I tried the code by using this also but it is not working.I just want to ask you on question can we pass or access session variable in js file if yes then how.
|
|
|
|
|
session is created in Server Side,
You need to call AJAX request for the session from javascript.
Abhishek Sur
|
|
|
|
|
You can access a Session variable in javascript function.Example:
function GetUser()
{
var user='<%=Session["userid"]%>';
alert(user);
}
now it shows the current value of Session["userid"].
ARINDAM
|
|
|
|
|
ARINDAM1981 wrote: var user='<%=Session["userid"]%>';
<%= >
is a ASP server side tag, it will execute the code and will replaced by the result.
The above code you have pasted is a code that is not executed.
View the page in browser and output will be in form
var user='some text';
|
|
|
|
|
It's obvious you have no idea what you're doing, perhaps you need to ask a higher level question about what it is that you're trying to achieve.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|