|
The problem was that I binded the Date to the CalendarExtender as:
<cc1:CalendarExtender ID="ceStart" runat="server" Format="dd.MM.yyyy" TargetControlID="tbDtmStart" SelectedDate='<%#(DateTime)DataBinder.Eval(Container.DataItem, "dtmStart")%>'><br />
All of my problems went away when I insted:
asp:TextBox ID="tbDtmStart" runat="server" Text='<%#((DateTime)DataBinder.Eval(Container.DataItem, "dtmStart")).ToString("dd.MM.yyyy")%>' AutoPostBack="true"></asp:TextBox><br />
<cc1:CalendarExtender ID="ceStart" runat="server" Format="dd.MM.yyyy" TargetControlID="tbDtmStart"><br />
</cc1:CalendarExtender>
Thomas
|
|
|
|
|
how to use the cursors for a select statement in a stored procedures to get the values in the asp.net applications
|
|
|
|
|
I think you need to do a brave bit more reading...
I think you want to execute your dataset using a SqlCommand object and then iterate through the results using a SqlDataReader.
You might want to have a look at the MS application block for data access, simplifies things a little:http://msdn2.microsoft.com/en-us/library/aa480458.aspx[^]
|
|
|
|
|
I created a web application in vs2008. I click run in that. It works. Then I create a virtual directory using IIS. From IIS itself, I try to run that application. But it shows the following error.
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
A name was started with an invalid character. Error processing resource 'http://localhost/example/'. Line 1, Position 2
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="example._default" %>
-^
Can anybody help me.
I am using IIS 5.1
Thanks in advance
Regards
|
|
|
|
|
Just delete your cookies and try again i think this could be your problem.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
|
hi guys,
I am stuck on the issue of being able to call a javascrip function from my c# code.
This is my javascript:
<br />
<SCRIPT LANGUAGE="JScript"><br />
function showPosition()<br />
{<br />
var oElement = document.all.resultPanel;<br />
return oElement.offsetLeft;<br />
}<br />
</SCRIPT><br />
The javascript itself works fine, the problem comes down to how do I call my javascript in c#. This was my attempt:
<br />
private void CallJavascript()<br />
{<br />
string popupScript = "<SCRIPT LANGUAGE='JScript'>" + "function showPosition(){ var oElement = document.all.resultPanel; return oElement.offsetLeft;}</SCRIPT>";<br />
Page.RegisterStartupScript("PopupScript", popupScript);<br />
Label1.Text = popupScript.ToString();
}<br />
Can someone please help me correct the CallJavascript() method.
thanks
|
|
|
|
|
Page.ClientScript.RegisterStartupScript(me.GetType(), "dummyKey", "function name()", true);
|
|
|
|
|
jagadeeshkumar2106 wrote: Page.ClientScript.RegisterStartupScript(me.GetType(), "dummyKey", "function name()", true);
thanks for posting however i still dont get this ClientScript.RegisterStartupScript method. If my javascript is return a value how does this get handled in ClientScript.RegisterStartupScript ?
|
|
|
|
|
i think its better to keep in a hidden fiel value
|
|
|
|
|
A hidden field can be something similar to the input element as suggested in the example below ?
<br />
<script runat="server"><br />
public void Page_Load(Object sender, EventArgs e)<br />
{<br />
String csname2 = "ButtonClickScript";<br />
Type cstype = this.GetType();<br />
<br />
ClientScriptManager cs = Page.ClientScript;<br />
<br />
if (!cs.IsClientScriptBlockRegistered(cstype, csname2))<br />
{<br />
StringBuilder cstext2 = new StringBuilder();<br />
cstext2.Append("<script type=\"text/javascript\"> function DoClick() {");<br />
cstext2.Append("var oElement = document.all.Panel1; Form1.Message.value= oElement.offsetLeft;} </");<br />
cstext2.Append("script>");<br />
cs.RegisterClientScriptBlock(cstype, csname2, cstext2.ToString(), false);<br />
}<br />
}<br />
</script><br />
<html ><br />
<head><br />
<title>ClientScriptManager Example</title><br />
</head><br />
<body><br />
<form id="Form1"<br />
runat="server"><br />
<input type="text" id="Message" /> <br />
<input type="button" value="ClickMe" onclick="DoClick()" /><br />
<asp:Panel ID="Panel1" runat="server" style="position:absolute;top: 375px;left: 628px;height: 422px;width: 513px; border-color:Red;border-width:thick;border-style:solid"></asp:Panel><br />
</form><br />
</body><br />
</html><br />
edit: Example is based from MSDN article http://msdn2.microsoft.com/en-us/library/z9h4dk8y.aspx[^]
edit: sorry I worked out what a hidden field is thanks to google
http://msdn2.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlinputhidden(VS.71).aspx[^]
modified on Thursday, December 06, 2007 8:33:21 AM
|
|
|
|
|
hi friends
i will type any text in textbox. and chose any language that text will converted in that language example like englisg to french..
how to convert text like this anyone help me..........
|
|
|
|
|
1. The pros of "GetLocalResourceObject" and "GetGlobalResourceObject" is to help you achieve
Gloabalization and Localization easily. Cons is that writing code is a little complex than usual.
2. You can use Xml file instead of Resources, as resource itself is in xml format. I would not
suggest you use xml files, because you will lose the ability of using the build-in resource
Localization/Globalization support.
3. The captions of controls should also be get from the resource file.
4. Since .NET 3.5 hasn't been released yet, I do not know whether it will have any new feature on
this.
You can take a look at the following links for more information
http://msdn2.microsoft.com/en-us/library/ms227982.aspx[^]
http://msdn2.microsoft.com/en-us/library/c6zyy3s9.aspx[^]
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
You need to have the translation service for that. so, you may develop your own one or you can use the third-party translation web services....
|
|
|
|
|
hi everyone,
I have 4 DropDownList controls which are used to take the starting time and ending time of a business. I only take hours and minutes for the Starting time.
Now I want to put some client side validation so that the starting time is less than the ending time. I'm using 24 hour notation so AM/PM is not an issue.
How can i make use of Javascript here. plz give me some idea/guidance/code sample(if any)
Thanks in advance
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
You can add javascript like DropDownList.Attributes.Add("OnClick","YourJS()");. Onclick is the event and can be anything applicable to dropdownlist.
|
|
|
|
|
Hello Friends,
I'm opening a small window
window.open("Default2.aspx",'','width=400,height=400,srollbars=1');
and it is opening a small window in Internet Explorer but not in Mozilla
but in Mozilla it's opening the window in a new tab but i want to open in a small window as i've described above
|
|
|
|
|
Is your Mozilla browser the latest version??
If yes then you can try this page in Mozilla.. then, click "open popup" link and see whether you got new window or not..
http://www.quirksmode.org/js/popup.html[^]
|
|
|
|
|
Hello Michael,
I've opened that url in Mozilla and clicked on "open popup" but it did not open a new window but being opened in a new tab in Mozilla but running great in IE.........
Now can u let me know why it's happening
|
|
|
|
|
which version of Mozilla are you using? I will try on my machine.. i think there might be some configs to do that
|
|
|
|
|
how i can get a select statment results form a stored procedures ie select statement returns a multi set values how this can be retrived
|
|
|
|
|
how can i add child grid in to Parent Grid view and populate it
wasim khan
|
|
|
|
|
I have a TextBox in which Date Of Birth is entered...How can i calculate the AGE...Any idea is helpfull.
Thanks in Advance...
Erasers are for people who are willing to correct their mistakes.
|
|
|
|
|
Just store the DOB from the text box and use this
it would be simpler for you to calculate age in your database server
like
SELECT DATEDIFF(year, yourbirthdayfield, GETDATE()) AS Age
FROM YourTable
this will return the a field in your query that has the age.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Why simpler in database? It's pretty much the same in .net code?
|
|
|
|