|
Hi All,
I want to Add Search Facility to my page. I mean Search From Date to Date. I dont know which control should I use for that. I mean Calender control or there is some special control for that. Can any one help me about that. Also plz tell me about query. Which query should I use. I m new to programming.
Thanks in Advance.
|
|
|
|
|
hi
You can use two calendar controls like
In your Form,have
From Date[as Label] -- [have a Textbox here]--Calendar Control1
To Date[as Label] -- [have a TextBox here]--Calendar Control2
Search[as Button]
Assign the date you have selected in the Calendar control to the respective textboxes and Search accordingly.
Similar samples are available in this site itself.
One of it is Here http://www.codeproject.com/aspnet/RayCheng_MyCalendar.asp[^]
~Happy Coding
|
|
|
|
|
i need previous 3 months calender.
dont extent current date.
i used for 3 months 3 calenders but it crossing current date ...give me solution.....
<asp:calendar nextprevstyle-font-strikeout="false" id="lblCalender" runat="server" shownextprevmonth="False">
<nextprevstyle font-strikeout="False">
<asp:calendar nextprevstyle-font-strikeout="false" id="lblCalender" runat="server" shownextprevmonth="False">
<nextprevstyle font-strikeout="False">
<asp:calendar nextprevstyle-font-strikeout="false" id="lblCalender" runat="server" shownextprevmonth="False">
<nextprevstyle font-strikeout="False">
|
|
|
|
|
Well, I tried formatting the listbox to give the appearance
of columns like :
xxx.....bbbb...dddd )I had to add "."s here!)
111.....22.....333
but no matter what, setting DataTextString="{0,-18} or
anything else, it strips out padded spaces:
xxx bbbb dddd
am I barking up the wrong control tree? Maybe a datagrid?
The box is filled from a: DataSet.Table("aa")..
using Vis Studio 2005..
ALSO..the TextChanged and SelectedIndexChanged dont fire until
I hit a button which causes postback..??
Thanks for helping..
-- modified at 21:17 Sunday 25th February, 2007
|
|
|
|
|
bgriffin_tpa wrote: ALSO..the TextChanged and SelectedIndexChanged dont fire until
I hit a button which causes postback..??
Set the autopostback property to true.
bgriffin_tpa wrote: am I barking up the wrong control tree? Maybe a datagrid?
It would be a lot easier...
Mihai,
|
|
|
|
|
I know..figured out what I wasnt doing only
several minutes later..was sure I had already
tried that, but did it again and it worked..
can you help with the formatting issue? Thats
what I really needed most..
|
|
|
|
|
have a good time friends...
i have asp.net application that i write it by c#.net
now i dont know how to create a tab control in asp.net
if everybody know it please help me
its not important that suggest me a web user control or else
thank you.msma
oh my god
im alone and alone
and nobody close me
no body know me
nobosy love me
nobody like me
but i have u
you like me
u love me
u power me
and u are all of my things...
thank u
|
|
|
|
|
There's at least one tab control on this site. A tab control is just a user control that renders the tabs, and renders the selected one differently. You then put it on all your pages, and on each page, set which tab is selected. It then renders links to the other pages, on the other tabs.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
helloo
if I made web service in .net
can it be used in jave
I thinks its yes
but am not very sure
|
|
|
|
|
Yes, web services work to a common interface.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Is it possible to check the value of a user control, used on a website by means of a client script on that website. I think it should be of cource, but the 'element.value' notation doesn't work. My user control contains a listbox, initialized in the user control's code. What I'm doing wrong?
Wilfried
|
|
|
|
|
View the source of the page, and you will see that the id of the element is not just "element", but the name of other controls has been prepended to the name.
Use the ClientID property to get the full id that you can use in client code.
I recommend that you use the document.getElementById method instead of just referring to the elements as if they were global variables. It works in most browser in most of the cases, but not always.
A common shorthand for the getElementById is the $ function:
function $(id) { return document.getElementById(id); }
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks for answering.
Sorry probably my description was not precise. I used the normal access methods already. My user control has the ID sodatum, so I try to access it by:
sodatum.value or
document.getElementById("sodatum").value
but it both returns null. There is another textbox on the same page, named 'artnr' and even another listbox too, both of them accessible.
It must be, because it's a user control. It's implemented in the following way:
<%@ Register TagPrefix="ucSod" TagName="sodat" Src="~/uc/sodatum.ascx" %>
<%@ Page Language="VB" CodeFile="Suche.aspx.vb" Inherits="Suche" %>
<script type ="text/ecmascript">
alert(document.getElementById("artnr").value;
alert(document.getElementById("sodatum").value;
</script>
<form id="frmSuchen" runat="server" method="post">
|asp:TextBox ID="artnr" runat="server" </asp:TextBox>
|ucSod:sodat ID="sodatum" runat="server"/>
</form>
I used '|' instead of '<' here, because otherwise it's not properly displayed in this forum message. In the code there are '<' of course.
The first alert works, the second doesn't.
Wilfried
|
|
|
|
|
wilf57 wrote: The first alert works, the second doesn't.
No, neither of them works. The first alert shows the value of the 'artnr' textbox in the page, not the 'artnr' textbox in the user control.
---
single minded; short sighted; long gone;
|
|
|
|
|
So I found the sh*t myself
asp.net renders a user control differnt than a normal control. The ID of a user control on the webpage is a combination of the ID used on the page and that in the user control HTML code.
Best way: look at the source code of the page created by asp.net and wich ID asp.net used to address the specific control.
Ex.
If the user control is implemented the following way:
|ucSod:sodat ID="sodatum" runat="server"/>
client script access is thru: formxxx.sodatum_sodat.value
(there's a '<' instead of the '|', but then it's not displayed in the forum, why???
-- modified at 9:36 Monday 26th February, 2007
|
|
|
|
|
wilf57 wrote: So I found the sh*t myself
asp.net renders a user control differnt than a normal control. The ID of a user control on the webpage is a combination of the ID used on the page and that in the user control HTML code.
I told you so. Didn't you read my post before you replied to it?
Best way: look at the source code of the page created by asp.net and wich ID asp.net used to address the specific control.
No, the best way is to use the ClientID property, just as I wrote in my previous post. The way that the id is created may change with the version of framework, but the ClientID property will always return the correct id.
---
single minded; short sighted; long gone;
|
|
|
|
|
the last one is an argument, but still:
if there is a user control on the page like this:
<ucSod:sodat ID="sodatum" runat="server"/>
then
document.getElementById("sodatum").value
doesn't work
what works is:
document.getElementById("sodatum_sodat").value
try it (I'm using ie6)
for me it seems logical, because if the control's ID in the server produced HTML code is 'sodatum_sodat' any javascript cannot access the control by 'sodatum'
|
|
|
|
|
You are completely missing the point.
Use the ClientID property to get the name to use in the client code.
If you hard code the name, your code only works with the exact structure that your page has. If anything changes in that structure, the name changes. Also, you can only use the code for that single page, you can't put the user control in another page if it doesn't have the exact same structure.
Also, if you deply the application to a web server, it's not certain that it will use the same pattern to create the name. An update of IIS or the framework may also change the way that the name is constructed.
---
single minded; short sighted; long gone;
|
|
|
|
|
Ok I got that. I read about it in the help too.
<form id="frmSuchen" runat="server" method="post">
<asp:TextBox ID="artnr" runat="server"></asp:TextBox>
<ucSod:sodat ID="sodatum" runat="server"/>
</form>
Now I tried this in the client script:
document.getElementById("<%=artnr.ClientID%>").value
document.getElementById("<%=sodatum.ClientID%>").value
the first statement with the textbox works fine, the second one with the user control doesn't it says:
document.getElementById("<%=sodatum.ClientID%>")is not an object.
and indeed when I execute on the server side (in page_load() or even aftzer loading in a button event:
Msgbox me.sodatum.ClientID
it always prints 'sodatum' and not 'sodatum_sodat' as I'd have expected.
any explainations?
Thanks for your patience
Wilfried
|
|
|
|
|
Is the client script inside the user control? Otherwise you can not reference the controls in that way, you have to specify that they are in the user control. You also have to change their accessibility to public, or expose them through public properties in the user control.
Are you sure that the first one works correctly? Do you get the value from the field in the user control and not the field in the page?
---
single minded; short sighted; long gone;
|
|
|
|
|
The first one is simply a textbox on the page. Thats why it works fine.
The client script is on the page, not in the user control.
I wrote a public property (Text) in the user control, so I can read and write the listbox(the one in the user control) on the server side but that doesn't help on the page client side, right?!
So you say in the page client script I cannot access the listbox inside the user control by its ClientID property , only by the hard coded ID.
Ok next week I'm going skiing, I have do deal with that thing after that.
Thanks again
Wilfried
|
|
|
|
|
wilf57 wrote: I wrote a public property (Text) in the user control, so I can read and write the listbox(the one in the user control) on the server side but that doesn't help on the page client side, right?!
The property is not for use on the client side, but on the server side.
wilf57 wrote: So you say in the page client script I cannot access the listbox inside the user control by its ClientID property , only by the hard coded ID.
You can never access a control from the client side, regardless of where it is. The control only exists on the server side, the only thing that is left of it on the client side is the html elements that it renders.
The concept of a user control doesn't exist on the client side. You can access any element in the page, regardless of how the code for it is created on the server.
What you have to do is simply get access to the right control so that you can get the ClientID for it, then you can use that in the client code to access the control without problem.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi All
I want to link the data result set from the database, to a DataGrid. I want to display it other than just columns as it comes from the database.
ie. The usual DataGrid format
------------------------------------------------------
Column Data | Column Data | Column Data | Column Data
------------------------------------------------------
I want to display like this:
-------------------------------
Column Data |
-------------|
Column Data | Column Data
-------------|
Column Data |
-------------------------------
Hope that makes sense.
Thanks in advance.
|
|
|
|
|
You can do that,
use Template Field columns in grid view and arrange the column data as needed.
but you can bind the controls using server tags not by data field property.
like Text='<%#DataBinder.Eval(DataBinder.GetDataItem(Container),"Key")%>'
<asp:GridView runat="server" ID="CustomGridView">
<Columns>
<asp:TemplateField>
place you controls as needed here...
</asp:TemplateField>
</Columns>
</asp:GridView>
Cheers
asithangae
|
|
|
|
|