|
Uh, copy the entire contents of www.maps.google.com servers from another workstation that does have access to it and then put it on your multi-million dollar servers . . .?
OK, I'm being a crass (minus the "cr").
If you have no access to maps.google.com (note that you do not need the "www."), then you necessarily can not incorporate it into your .NET application.
If your development workstation has no access to to maps.google.com, but the server wherein your .NET application does have access, then that's a predicament for you.
GN
ASPX ~ Apple Simply Performs Xcellently
|
|
|
|
|
Hi,
I have written the javascript function in the External js file and named it as JScript.js. This file is in Javascripts folder which under the Project folder.
The JScript.js file contains the following code.
// JScript File
function validateParameter()
{
var paramname=document.getElementById('<%=txtParam.ClientID %>');
var message;
message="";
if(paramname.value=="")
{
message+="\n*Parameter Name is mandatory";
}
else if(paramname.value!="")
{
var alphaExp = /^[a-zA-Z\s]+$/;
if(!paramname.value.match(alphaExp))
{
message+="\n*Only Alphabets are allowed for Parameter Name";
}
}
if(message!="")
{
alert(message);
return false;
}
return true;
}
I have called the javascript file using the below html tag.
I have called the javascript function for OnClientClick of a button.
OnClientClick="javascript: return validateParameter();"
But during the runtime the button click is not validating the controls.
Please Help Me! Thanks.
|
|
|
|
|
Best way is to install Firebug or use the Firefox error console to know what's wrong with your JS.
anandhakrishnan wrote: var paramname=document.getElementById('<%=txtParam.ClientID %>');
I am not sure, but I think the client id used in external JS will not get rendered. Have you checked? If it is not rendering, just pass the id as function parameter. Something like
function validateParameter(textBoxId)
{
var paramname = document.getElementById(textBoxId);
....
}
OnClientClick="javascript: return validateParameter('<%=txtParam.ClientID %>');"
|
|
|
|
|
anandhakrishnan wrote: I have called the javascript file using the below html tag.
I have called the javascript function for OnClientClick of a button.
OnClientClick="javascript: return validateParameter();"
First try with alert on that method and check weather its called or not.
Then
You should pass the clientID also to the ValidateParameter().
anandhakrishnan wrote: OnClientClick="javascript: return validateParameter();"
OnClientClick="javascript: return validateParameter(ClientID);"
|
|
|
|
|
Hi Experts,
I currently have a crystal report on live and if the report has parameters and the report would automatically prompt the user for the required arguments itself, i did not input the argument fields for user to enter but the report does it automatically but when I click "OK" it gives me a null reference exception.
How do I overcome this problem?
Thanks in advance! ^^
Cheers!
|
|
|
|
|
What Is a User-Control Embedded Class?
A User-Control Embedded Class is a user-control with no U.I. but has a separate class (such as public class MyEmbeddedClass() { }) located just below the user-control's partial class, and the class is just like any other class, having properties, private and static methods (mostly static), etc., such that when the user-control is placed on a web page, only that webpage wherein the user-control is placed on can now call MyEmbeddedClass() methods.
And, in a web app that compiles on the fly, only that web page is impacted when MyEmbeddedClass (located in the user-class'es code-behind) is changed.
Usage:
Create a user control called classMyStuffcontrol.ascx, then add a SEPARATE class to it as follows
<br />
public class MyStuff(){<br />
<br />
}<br />
We'll pretend it is a decent sized class, having 12 or so static methods (functions), around 500 lines of code.
Focus #1: Now, this user control is needed on about 7 web pages and 3 other user controls.
1) Does this mean, in Focus #1, that there would be 10 instances of the class Mystuff (within classMyStuffcontrol.ascx), even though there are only static methods?
Focus #2: Now, one of those pages which already uses one of the user controls that has MyStuff() in use also needs access to the class MyStuff, so I add the MyStuffControl to the web page as well..
2) Does this mean that there are multiple instances of the class MyStuff for that webpage and user-control, both using classMyStuffcontrol.ascx, would there be 2 instances of the class MyStuff instantiated even though there are only static methods?
Now, before ya start asking "why", here's why I do this:
- some 3 years ago I was asked to create a single user control that did tons of stuff; no extra files would be accepted. So I coded the whole thing in a single UI page and corresponding code-behind page (those 2 files were acceptable). The code behind had 6 separate classes which focused on a given set of tasks.
Soon after this, a different client asked for the same thing once they became aware that I ahd done something like this already. From there, it kept snowballing; client after client wanted similar output (1 or 2 files containing all the code for a big solution.
After 6 months, I set aside this 'practice', but a few months later started using it wherein only a single class was associated to a single user-control. Now, there are still the universal / web-app-wide classes I used, but alot of the other classes were specific to a given area, and/or not used as much as a webapp-wide class would be used.
What this permitted was my ability to change the user-control embedded class, affecting only those web pages (wherein an on-the-fly compile took care of it) versus a web-app restart (such as what occurs when the web.config file is changed).
Have I described this enough such that you would be able to provide feedback as to its usefulness and/or practicality? Specifically, am I asking for trouble down the line or are user-control embedded classes, when used in moderation, a reasonable solution?
Thx,
Gary Noter
ASP ~ Apple Simply Performs
|
|
|
|
|
Hi,
I've created an ASP.NET web application using C#. My first page takes creates a text file that is shared on my network and is used as a log file for another program. The text file name has a datetime stamp in it (ex: File_2009_01_21_13_33.txt). On my second page, I need to open this text file instance and read it and write the last line to the webpage.
I cannot figure out how to pass the text file name from the first webpage to the second web page. I need to use the exact path and derive the file name from that because there is the possibility that multiply text files can exist in the folder and be running at the same time. If anyone knows how I would greatly appreciated some help!
Thank you.
|
|
|
|
|
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).
|
|
|
|