|
hiii
this will definately work just change ur str2 to belove
str2 = "select * from Birthday WHERE (DATEPART('m', BDate)) = '" & Date.Today.Month & "' And (DATEPART('d', BDate)) = '" & Date.Today.Day & "'"
cm = New OleDbCommand(str2, con)
GridView1.DataSource = cm.ExecuteReader(CommandBehavior.CloseConnection)
GridView1.DataBind()
Jintal Patel
|
|
|
|
|
You have no idea how much this means to me.It works like a charm.
I wud buy you lunch, but ur there.Thanx a million.
Damn, thank you very much.
kagiso
|
|
|
|
|
|
matjame wrote: the problem is that the values I have to give it are system generated(i.e the day and month I get from the database are compared to the day and month from my machine) so I cant use that method.
Yes, you can. The @mt and @dt values are parameters. Add two parameter objects to the command object, with the values for the month and day.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
How can i call a javascript function from a Contentplaceholder?
can we get document object from here?
Thanks and Regards
Yesuprakash
|
|
|
|
|
ypki wrote: Contentplaceholder?
can we get document object from here?
Javascript don't understand Master pages/Content pages. All these will be rendered together to produce page. So you can write it anywhere.
|
|
|
|
|
but i cant get the control in content.
I try document.formname.textbox1 and document.getelementbyid("textbox1")
both showing unidentify in javascript
I am trying to use calenser control
|
|
|
|
|
ypki wrote: I try document.formname.textbox1 and document.getelementbyid("textbox1")
document.getElementById(<% textbox1.ClientId > )
|
|
|
|
|
Hi,
after running your application page,see page source. In that you will see that your control named textbox1 is chaged to "ctl00_contextplaceholderName_textbox1". so see that new ID and then get from javascript.
Thanks,
Sun Rays
|
|
|
|
|
hi...
i am having a contentpage which has many textboxes.Pls let me know the code(in c#)to clear textboxes at a button click.
SunithaNallana
|
|
|
|
|
SunithaNallana wrote: to clear textboxes at a button click.
Clearing textbox value ?
|
|
|
|
|
yes to clear textboxes values
SunithaNallana
|
|
|
|
|
Content place holder will have Control collection property. Iterate through each item and check if it is TextBox. If yes clear the text.
|
|
|
|
|
thank u all
i cleared my doubt.
i have done it this way...
1.in the master page i put a property block in which i wrote
public ContentPlaceHolder CPH
{
get{return ContentPlaceHolderid;}
}
2.i made the content page strongly typed ie..
<mastertype virtualpath="masterpagefile path">
3.in button click function
foreach(control c in Master.CPH.Controls)
{
if(c.getType().Name == "TextBox")
{
(c as TextBox).Text ="";
}
}
SunithaNallana
|
|
|
|
|
Not a good way of doing but you can try
ArrayList al = new ArrayList();
foreach(Control c in Page.Form.Controls)
{
if(c.GetType() == typeof(TextBox))
{
al.Add(c);
}
}
foreach(TextBox t in al)
{
t.Text = "";
}
But There should be any other better way to do it.
here I have assumed that you have all the textboxes in same form. In case its not true You will have to loop through all the forms.
Happy Birthday!!!
|
|
|
|
|
Prateek G wrote: ArrayList al = new ArrayList();
foreach(Control c in Page.Form.Controls)
{
if(c.GetType() == typeof(TextBox))
{
al.Add(c);
}
}
foreach(TextBox t in al)
{
t.Text = "";
}
No need to loop 2 Times.
foreach(Control c in Page.Form.Controls)
{
if(c.GetType() == typeof(TextBox))
{
Textbox t = (Textbox)c;
t.Text = "";
}
}
Thanks,
Sun Rays
|
|
|
|
|
Prateek G wrote: foreach(Control c in Page.Form.Controls)
This will clear all textbox controls in page. I think question is how to clear the textbox in content place holder.
|
|
|
|
|
thank u all
i cleared my doubt.
i have done it this way...
1.in the master page i put a property block in which i wrote
public ContentPlaceHolder CPH
{
get{return ContentPlaceHolderid;}
}
2.i made the content page strongly typed ie..
<mastertype virtualpath="masterpagefile path">
3.in button click function
foreach(control c in Master.CPH.Controls)
{
if(c.getType().Name == "TextBox")
{
(c as TextBox).Text ="";
}
}
SunithaNallana
|
|
|
|
|
thank u Prateek.G
for wishing me on my birthday.
SunithaNallana
|
|
|
|
|
Try this and call this function on the server side.
< script >
function Clear()
{
obj=document.getElementsByTagName("INPUT");
for(i=0;i< obj.length;i++)
{
if ((obj[i].type == "text"))
{
obj[i].value = "";
}
}
< /script >
Let me know whether you got the solution.
God is always with you.
|
|
|
|
|
Saranya Devi wrote: function Clear()
{
obj=document.getElementsByTagName("INPUT");
for(i=0;i< obj.length;i++)
{
if ((obj[i].type == "text"))
{
obj[i].value = "";
}
}
This will clear all textboxes, not in the controls in content page
|
|
|
|
|
thank u all
i cleared my doubt.
i have done it this way...
1.in the master page i put a property block in which i wrote
public ContentPlaceHolder CPH
{
get{return ContentPlaceHolderid;}
}
2.i made the content page strongly typed ie..
<mastertype virtualpath="masterpagefile path">
3.in button click function
foreach(control c in Master.CPH.Controls)
{
if(c.getType().Name == "TextBox")
{
(c as TextBox).Text ="";
}
}
SunithaNallana
|
|
|
|
|
hi friends
now i am doing content management system(CMS)..
my doubt is i have one dropdownlist like this
<asp:dropdownlist id="ddlalign" autopostback="true" runat="server">
<asp:listitem value="Left">Left
<asp:listitem value="Right">Right
<asp:listitem value="Center">Center
if i do some modification in the page then i click left modified page will display in left place of enduser page.
how can i do this
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
You could look at the stuff in 2005 that supports being able to drag and drop to move parts of the UI. Otherwise, the answer is you need to remember the settings and write code that dynamically places UI elements.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
This is a pretty basic task. Do you not know how to access the roles from your database ? Don't know how to use a grid control to render the roles from the DB and dynamically check them ? Have you thought to ask your co-workers, given that the answer really depends on the way that your roles are stored, etc ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|