|
Instead of www.rediff.com, use http://www.rediff.com and it will work fine.
|
|
|
|
|
Hi All,
I want to develop a <b>Fundraising thermometer</b> using asp.net and c#. I am able to develop this using a Background Image as Thermometer. Here i want the image developed at each and every stage to be stored in the database. So I need the Image also to be generated.
Please Help in this issue
Thanks in Advance
ukrajudotnet
ukraju
dotnet
|
|
|
|
|
I'm trying to add a small (tiny!) javascript function to my ASP project.
I'm using 2.0 and C#. My site uses Master pages so I don't think I can directly edit the element.
The following shows my master page, to which I'm trying to add a javascript function - just for testing at the moment.
2 questions -
1) The current code gives a CS0246 error - "The type or namespace name 'function' could not be found (are you missing a using directive or an assembly reference?)" for both 'var' and 'function. What do I need in order to declare functions this way?
2) Given that I can't edit the element, how do I actually call the function? Do I call it from within the Page_Load event?
Many thanks,
Alice
<%@ Master Language="C#"%>
var str = "This is the test string.";
function myFunction()
{
str+=" The string was changed by myFunction. ";
return (str);
}
protected void Page_Load(object sender, EventArgs e)
{
}
<title>Page title
|
|
|
|
|
I think the better question is what exactly are you trying to do. This is some sample code just to try to get some javascript working. What is your real question? To call a javascript function you can do it in the page load. You have to register the javascript like this:
Type cstype = this.GetType();
ClientScriptManager cs = Page.ClientScript;
if (!cs.IsStartupScriptRegistered(cstype, "myFunc"))
{
cs.RegisterStartupScript(cstype, "myFunc", "myFunction();", true);
}
Hope that helps.
Ben
|
|
|
|
|
kubben wrote: I think the better question is what exactly are you trying to do.
The real use will be to declare a couple of functions to allow me to open and close a popup window. I have users log in on one page, from where I want to launch the popup which runs a seperate chatbot application. Users then play around in other pages until they log out. When they hit the log out button I want to be able to close the chatbot. I'm thinking that because all these pages share the same master, if I declare the open and close popup window functions in the master page, then I'll be able to call chatbotwindow.close() even though chatbotwindow was defined (by chatbotwindow = window.open() ) on a separate page.
I'm 100% new to javascript, and not that experienced with ASP.NET, so I'm probably making this harder than it needs to be but I'm finding it really hard to integrate the javascript into my code (possibly because I've used Master pages and code behind, which seem to have hindered things)
Thanks for your comments!
Alice
|
|
|
|
|
A better implementation would be to ceate a javascript library and include it in the pages.
MasterPages and code behind aren't the problem. If they are hindering things for you, you need to do more research on usage.
only two letters away from being an asset
|
|
|
|
|
kubben wrote: To call a javascript function you can do it in the page load.
This doesn't "call" the javascript. It places the script at the top (or at least near the top) of the rendered output.
only two letters away from being an asset
|
|
|
|
|
Yes that is true, I didn't word my response carefully. Thanks for making it clear to her what is going on.
Ben
|
|
|
|
|
Maybe a typo but you are missing the closing </script>
Why can't you modify the body tag? <body onLoad="myFunction" >
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: Why can't you modify the body tag? <body onLoad="myFunction" >
It seems that because I have a Master page which includes a ContentPlaceHolder I can't add text... I get the following error if I do:
"Validation (XHTML 1.0 Transitional): Text is not allowed between the opening and closing tags for element body'."
If I type onLoad="myFunction" into the it shows the text 'onload' at the top of the rendered page... so what am I doing wrong here?
Thanks,
A
|
|
|
|
|
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script language="javascript" type="text/javascript">
function myFunction()
{
alert("Entered myFunction");
}
</script>
</head>
<body onload="myFunction()">
<form id="form1" runat="server">
<div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</form>
</body>
</html>
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: </blockquote>
Thanks very much Mark - this is so close, but back to an error I've seen before (it turns out I can't have been so far from getting it already!)
With the code as you gave it, I get the folloing error "Cannot use 'javascript' because another language has been specified earlier in this page (or was implied from a CodeFile attribute)."
If I remove language="javascript" line, I'm back to getting the "The type or namespace name 'function' could not be found (are you missing a using directive or an assembly reference?)" error.
Any ideas?
(You can have your two crucial letters, you are an asset )
|
|
|
|
|
And do you have another language specified? Perhaps you code post the snippet that is giving you problems.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: And do you have another language specified? Perhaps you code post the snippet that is giving you problems.
Certainly
My master page is this:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="~/LoginMaster.master.cs" Inherits="LoginMaster" %>
function myFunction()
{
alert("Entered myFunction");
}
protected void Page_Load(object sender, EventArgs e)
{
}
<title>Page title
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
And the Code File (LoginMaster.master.cs) is just this:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Login : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
So I don't think I'm intentionally specifying a language anywhere, other than the Master Language in the page declaration - but that's standard isn't it(?), and only as you had it in the suggested code.
Thanks again!
A
|
|
|
|
|
You do not need to include the Page_Load event in the script block, it is already in the code behind. By doing so you are trying to use two languages in the same block, which is where the build error is coming from. If you need to include server-side script, it needs to be in a seperate script block.
Also remove the runat=server from the script block for javascript.
only two letters away from being an asset
|
|
|
|
|
A client script tag should not have runat="server".
You can't mix client script and server script in the same script tag.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi All,
How to register in MSDN Subscriptions,Pls send me link if anybody have?
Thanks.
|
|
|
|
|
I am using Visual Studio .NET 2003 to develop the application. My issue is that i had to generate a Word Report with password from an ASP.NET web application.
After much try i got the dll Microsoft Word 11.0 Object Library and with the help of which while trying to generate a word document with password from a application it was throwing a runtime exception.I had to impersonate the user as it showed an acces violation.
COMException (0x800a175d): Could not open macro storage.
When performed a search with this, i came to know the necessity of configuring the Word application of the server with DCOMCNFG - as setting the word to be run under interactive user mode etc. But that is very risky as listed in the links,
[url]http://support.microsoft.com/kb/q288366/[/url] -- (Explains how to configure with DCOMCNFG)
[url]http://support.microsoft.com/kb/257757/[/url]
Can any body tell me how to solve this without using DCOMCNFG ?
The following link tells me that it can also be achieved by saving the document as XML and manipulating the XML.
http://www.thescripts.com/forum/thread374627.html
Is it possible to set a password while generating with the XML ? .. i don't think that it is possible but still....
Then how to stream that file to the client ?
If any body could give me any suggestions or links i'll be grateful...!
Your suggestions might be of great value....
If anybody comes across any link or any thing please do reply ....
I will be very grateful...
-- modified at 8:25 Wednesday 4th April, 2007
jij
|
|
|
|
|
How can I make one masterpage on hole server. I have about 20 different application and they all are placed allover the network. I'm cleaning the main application's on one server and making them look like same. My idea is that I have one masterpage that is my homepage and then if user uses some application the application opens in contentplaceholder and in the masterpage has site map so user can go back to the main page or subpage.
The application can bee something like this homepage->sales->application
Thanks
|
|
|
|
|
We are developing application using .Net 2.0 , Vb.net. We have a following requirement
We need to develop a user control or a master page which has the following menus: Save, Submit: Approve
This User control or a master will be included in webpage A, B, C. When we are in Webpage A, on click of Save ( on control ), the save functionality of Page A should be called. When we are in Page B, on click of Save, the save functionality of Page B is called. If some one know how to achieve this functionality let me know and any sample code is very useful
Thanks and regards
shyam
|
|
|
|
|
It's called Event Handling
only two letters away from being an asset
|
|
|
|
|
n my project have sub menu . When I click the sub menu option ,it displayed everything.
In Main page have two drop down lists. When I was moving to upward the sub Menu, two drop down lists will display in the title bar of the SubMenu . The title bar contains the title and Close(hyperlink) .The title bar is div control.
Is it possible to hide the drop down lists when I moving to drop down lists?. The drop down lists are dynamically created.
Apart from "Z-Index". Pls give the solution as soon as possible.
|
|
|
|
|
z-index does not work for listboxes, but there is a way of making this happen using an iframe under your divs, please see here[^] as an example.
|
|
|
|
|
Mr.Paddy Boyd,
In my sub menu Iframe has been used. Is it any way to overcome this problem?
-- modified at 7:01 Wednesday 4th April, 2007
|
|
|
|
|
And that hasn't fixed your problem?
|
|
|
|