|
New web host maybe
|
|
|
|
|
As long as MasterPage and WebForm are in the same directory the JavaScript file works but when the directories are different I get javascript error cuz the file was not found.
I tried to google this problem and found that if you put the script block within the < HEAD >, ASP.NET 2.0 runtime will resolve the URL but for some odd reason that is not the case here.
Here is how I am doing it:
the file is inside a folder called JavaScript which is right under root folder.
I tried this first:
<head>
<script src="/Javascript/x.js" type="text/javascript"></script>
</head>
Then I tried this:
<head>
<script src="x.js" type="text/javascript"></script>
</head>
Then I tried this, but I got an ugly error:
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
<head>
<script src=<%= ResolveClientUrl("x.js") %> type="text/javascript"></script>
</head>
Can someone tell me how to take care of this problem . Thanks in advance.
-- modified at 8:58 Thursday 4th May, 2006
|
|
|
|
|
Hi,
Try below code,
<script src="../Javascript/x.js" type="text/javascript"></script>
Hope it works...
|
|
|
|
|
Thanks for the reply, but
<script src="../Javascript/x.js" type="text/javascript"></script>
does not work.
|
|
|
|
|
Hi,
Try below code,
<script src="../Javascript/x.js" type="text/javascript"></script>
Hope it works..
|
|
|
|
|
Check if the framework resolves this:
<script src="~/Javascript/x.js" type="text/javascript"></script>
---
b { font-weight: normal; }
|
|
|
|
|
I have the following DataList
<div style="overflow:scroll;">
<asp:DataList ID="dlAvatar" runat="server" DataKeyField="FileName" RepeatLayout="Flow" RepeatDirection="Horizontal" SelectedItemStyle-BorderStyle="Inset" >
<ItemTemplate>
<asp:ImageButton ID="imgAvatarSelect" runat="server" OnCommand="Buttons_CommandEvent" ImageUrl='<%# Eval("FileName") %>' CommandArgument='<%# Eval("FileName") %>' CommandName="Select"/>
</ItemTemplate>
</asp:DataList>
</div>
I had it working in the file "ViewUser.aspx". Then I moved it to a page called "ChooseAvatar.aspx". It was working there too. Then, I moved it back to "ViewUser.aspx". And now it doesn't work.
It doesn't fire my event which is defined as so.
public void Buttons_CommandEvent(object sender, CommandEventArgs e)
{
int i = 0;
User user = Session["user"] as User;
if (user != null)
{
user.Avatar = Convert.ToString(e.CommandArgument);
user.Update();
if (user != null)
imgAvatar.ImageUrl = user.Avatar;
}
}
Is there some option is VS2005 IDE to get it to re-sync my page? Any ideas?
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Nevermind. The IDE is a piece of crap. I re-created the button and it finds the event now.
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
hi,
suppose that i have the string value "http://www.google.com" as NavigationUrl.
how can i load this page into a div running at server?
thanx
|
|
|
|
|
|
but how?
because "TreeNode.Target", having the value of iframe id "ifrUrl", did not work.
Do i have to run javascript? how?
thanx
|
|
|
|
|
Hello Friends,
I have a webform. There are 11 "RequiredFieldValidator" controls on this web form. If something goes wrong then validation controls warn me. That's ok.
There is another button on this webform that navigates to another webform.When I click this button validation controls dont allow me to navigate.
But suppose that I will do nothing on this page and I will navigate another page..How can I disable the effect of these validationcontrols when I click the button.
Please Help..
|
|
|
|
|
Hi innocent73,
just make the "CausesValidation" property of that Button(for which you dont want the validation to be executed)to
"False".
Tirthadip
|
|
|
|
|
Thank you so much....That's the answer!!
|
|
|
|
|
Good Question.
I just face this problem and find the solution.
So i glad to help to anybody.
see , when u create the requirefieldvalidatio at design time... set the property of it "EANBLED=FALSE"
so when u want to enable it then write the code for it like "requirefieldvalidator1.Enabled=True" and when u want to disable it then set the property "False"
i will give one more example
there is two button. like " save " and "cancle"
so u want "cancle" button cant fire the requirefieldvalidator then set the property of "cancle"
like "causevalidation=False"
it will work 100%
so enjoy..
Dipan Patel.
|
|
|
|
|
System.Data.OleDb.OleDbException: Could not find installable ISAM.
at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
at System.Data.OleDb.OleDbConnection.InitializeProvider()
at System.Data.OleDb.OleDbConnection.Open()
at DreamweaverCtrls.DataSet.DoInit()
-----------
All works fine on local test server and all pages other than the ONE works fine on live (The connection and web.config files must thus be correct????)
ALL data in the DB has got valid data in as well and although the file does also include canvas methods to display graphics I don't know if this is the problem. PLEASE any help?
It dose write the cookie data as well and retrieves it correctly it seems. ANY thing else it could be?
TOp part of my file is
-----------------------
<%@ Page Language="C#" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<mm:dataset
id="DataSet1"
runat="Server"
isstoredprocedure="false"
connectionstring="<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_GKAUser"] %>"
databasetype="<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_GKAUser"] %>"
commandtext="<%# "SELECT * FROM tblWOL WHERE usern = ? ORDER BY usern ASC" %>"
failureurl="<%# "noaccess.htm" %>"
debug="true"
=""><parameters><parameter name="@usern" value="<%# (Request.Cookies["AuthenticateGKDUser"] != null) ? Request.Cookies["AuthenticateGKDUser"].Value : "" %>" type="WChar">
<mm:pagebind runat="server" postbackbind="true">
<%@ Register TagPrefix="Portal" TagName="ImageCanvas" Src="ImageCanvas.ascx" %>
<%@ import Namespace="System.Drawing" %>
this is me
|
|
|
|
|
In my program.
i m displaying radio button in datagrid. not bind with database.
using Itemtemplate.
when i select any radio button. and click on any button it's retain checked but when i select any value from combo box it's become uncheck.
can any body help me out,
It's Urgent
|
|
|
|
|
Hi,
On Combobox selection the page is getting submitted so grid is binded again,
check for the 'AutoPostBack' of the combobox if it is 'true' make it to 'false'.
Hope this helps u..
|
|
|
|
|
Does anyone know a programmatic method of opening an external web page, populating input controls on that page and then submitting it?
The reason I am trying to do this is that I want to submit details to an external web site but I wish to do this via a page that I have created (so that I can capture the information also).
Any assistance with this would be greatly appreciated.
Thanks.
|
|
|
|
|
+ You can use the HttpWebRequest[^] object to submit data to an external web page, then read the result from the Response object. You can read more about this in MSDN[^].
+ Another option is to use the WebBrowser control to load the web page, then you can read the document object to get reference to the input controls and populate them, and finally submit the web page.
|
|
|
|
|
Hi minhpc_bk and thanks for your help.
I had a look at using the HttpWebRequest object and can see how you can use this to retrieve the html that makes up the specified URL. However, I couldn't work out or find and examples of how you can use this object to populate a web control with data and submit the page.
Would you need to use the HttpWebResponse object in conjuction with the HttpWebRequest object?
Thanks again.
|
|
|
|
|
mattdavies wrote: However, I couldn't work out or find and examples of how you can use this object to populate a web control with data and submit the page.
Hi Matt,
In fact, you don't use the HttpWebRequest to populate a web control, instead you use it to send data to a specified URL with the Post/Get method. Let me briefly describe it in a couple of steps in order to make it clear:
- Use the HttpWebRequest object to make a request to a specified URL.
- Read the output html markup from the HttpWebResponse object.
- You can choose a value for an input element from the retrieved html markup by using the regular expression, I mean you can use the Regex class to process the markup to select a value for an element like the dropdownlist, for the TextBox, you no need to process the markup.
Another way to visually choose a value for the input element is that you load the result html markup to a web browser control, then use the document object of the browser control to populate the input element.
- Arrange the data that you're gonna submit in the expected format, then use the HttpWebRequest object to submit data to the destination URL.
Like I said in the previous post, in addition to the HttpWebRequest object, you can also use the web browser control to navigate to a specified URL, and access the document object of the control, then you are able to get reference to the input control to populate it, it simulates the way you select a value for the input control in the browser.
mattdavies wrote: Would you need to use the HttpWebResponse object in conjuction with the HttpWebRequest object?
You normally use the HttpWebRequest to make a request to a specified URL to get info, and then in order to read the result html markup sent back from the server you will use the HttpWebResponse object (which is accessed from the GetResponse method of the HttpWebRequest object that you use to make a request earlier).
|
|
|
|
|
Hi minhpc_bk,
Thanks for your help - that makes a lot more sense. Apologies for not replying sooner but I have been away for a few weeks.
Thanks again.
Matt.
|
|
|
|
|
I am working on an ASP.NET application.. I have a form with a dropdownlist that is attached to the column of a database.
I will like the rest of the textboxes to be field up automatically depending on the selection from the dropdownlist. Values are all in the same table... can anyone help with this?
Commickey
|
|
|
|
|
Hi Commickey,
If you add a SelectedIndexChanged event handler to your code, you can determine what the user has selected in the drop down list by interogating the SelectedValue of the control.
Once you have this information you can then go back to your database table and retrieve associated information and populate the relevant text boxes.
Hope this helps.
|
|
|
|