|
how can i add attribute for a control in datagrid for javascript valiation?
i gave Dim hl As New HyperLink
hl = e.Item.FindControl("HyperLink1")
but showing error "Object reference not set to an instance of an object"
thks
yesu
|
|
|
|
|
when a grid is rendered on to the page ..ID of the control changes as DataGrid_ct1_... so use find control for this ID ...then it will work
Koushik
|
|
|
|
|
i find the control with this id..but it didt work.what is will be the full id for that?
i find by:
Dim hl As New HyperLink
hl = e.Item.FindControl("DataGrid_ct1_")
pleas make me correct..
thks
|
|
|
|
|
The id will be ataGrid_ct1_ + yourcontrolname
|
|
|
|
|
Hi
When grid is binded, it will raise ItemDataBound Event. You will get the current row in parameter e. Use that parameter and find the control. After that add attribute. It could be something like
HyperLink hyp = (HyperLink) e.Item.Cells[YourCellIndex].FindControl("HyperLink1");
|
|
|
|
|
i didt got the result
i am doing in vb.net
my code is
Dim hl As New HyperLink
hl = e.Item.Cells(0).FindControl("HyperLink1")
showing "Object reference not set to an instance of an object"
pls correct me..
thks
|
|
|
|
|
Protected Sub GVCartView_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVCartView.RowDataBound<br />
<br />
If e.Row.RowType = DataControlRowType.DataRow Then<br />
Dim btn As HyperLink= e.Row.FindControl("HyperlinkID")<br />
btn.Attributes.Add("onclick", "return function();")<br />
End If<br />
End Sub
I have done it in my project and its working
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELF
|
|
|
|
|
Hi guys,
Could some one help me out? I have a datagrid where one Row is for
selecting from radiobuttonlist of too, one has to be chosen. When it's
chosen it is stored in the database and appears to the datagrid after
the insert button pressed. But now I have two images that are supposed
to correspond each of the radiobutton. I made them visible="false" but
I want when one selects one radiobutton the corresponding image
appears along: Visible="True". How could I go about this?
Thank you
|
|
|
|
|
nclauder wrote: I want when one selects one radiobutton the corresponding image
appears along: Visible="True".
When radio button got the click call one javascript function. use the following code for hiding and showing image, let me assume all your image having unique id's.
document.getElementById("imageid").style.visibility = "none"
document.getElementById("imageid").style.visibility = "block"
|
|
|
|
|
Thanks Navaneeth,
I'm getting a little bit lost. When you give me this code how I'm i supposed to fix it into my code this is the code I'm using for the radiobutton.
The behind code:
protected void rblmood_SelectedIndexChanged(object sender,System.EventArgs e)
{
RadioButtonList rbl = (RadioButtonList)sender;
Control parent = rbl.Parent;
while(!(parent is System.Web.UI.WebControls.DataGridItem))
{
parent = parent.Parent;
}
}
protected int SetState(object st)
{
string state = st.ToString();
if(state.Equals("True"))
{
return 0;
}
else
{
return 1;
}
}
Html code is:
<asp:templatecolumn headertext="Mood Today">
<itemtemplate>
<asp:image id="imggm" runat="server" visible="False" imageurl="file:///C:\Inetpub\wwwroot\DashBoard\Moods\laughing.gif">
<asp:image id="imgbm" runat="server" visible="False" imageurl="file:///C:\Inetpub\wwwroot\DashBoard\Moods\sad.gif">
<asp:label id="Label2" runat="server" text="<%# DataBinder.Eval(Container,"DataItem.MoodToday")%>">Label
<edititemtemplate>
<asp:radiobuttonlist id="rblmood" runat="server" width="104px" autopostback="True" selectedindex="<%#SetState(DataBinder.Eval(Container.DataItem,"MoodToday"))%>" height="40px">
<asp:listitem value="Good Mood">Good Mood
<asp:listitem value="Bad Mood">Bad Mood
Thanks.
-- modified at 5:03 Friday 9th March, 2007
|
|
|
|
|
I have just tried your advice but I get an error:
The type or namespace name 'document' could not be found (are you missing a using directive or an assembly reference?)
What wrong?
Thanks.
|
|
|
|
|
Hi all
i have one doubt
How many config files we can have in one project ?
From my knowledge we can have as many as we have Directoreis in the project i.e each web.config for each directory ?
Here Directory Means What ? Folder where i have my pages here i am confused )
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
sandeep akhare wrote: How many config files we can have in one project ?
I think we can have only one web.config file for one website. If you are placing web.config file for each directories, i think it will be treated as different websites. Normally in my projects i do use directories. But all files inside these directories will be referring the root config file only.
|
|
|
|
|
HI Navaneeth
i thought same but after reading in MSDN i am confused
From MSDN
Configuration File Hierarchy and Inheritance
Each Web.config file applies configuration settings to the directory that it is in and to all of the child directories below it. Settings in child directories can optionally override or modify settings that are specified in parent directories. Configuration settings in a Web.config file can optionally be applied to individual files or subdirectories by specifying a path in a location element.
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Hi Sandeep
That was a good post.
sandeep akhare wrote: Each Web.config file applies configuration settings to the directory that it is in and to all of the child directories below it. Settings in child directories can optionally override or modify settings that are specified in parent directories
I tried this but i am getting error. Still it is refering the parent config file only. Any idea to override that in child directories ?
|
|
|
|
|
Navaneethkn wrote: That was a good post.
Thanks Navaneeth
Thats why i am also confused i didn't try it out but should know basic concept behind it thats why posted on forum
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Hi u can use more than one webconfig file in ur project,
its possible,but one webconfig file will be in normal,
other webconfig files want to be based on where its used in that folders we want to put it...........,
eg:take role based authentication,
eg,admin,user each one have diff roles,so in admin folder u must tell ur webcofig file for that,
like that user folder also u want to mention ur webconfig,
then normally outside one webconfig file will be there....
i hope u will understood..........
Magi
|
|
|
|
|
Thats nice
but can you provide one example/article where i can play with it
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
have the coding to encrypt password:
private void Page_Load(object sender, System.EventArgs e)
{
if (this.IsPostBack == false) {
ddlChooseAlgo.Items.Add("");
ddlChooseAlgo.SelectedValue = "";
}
}
private void cmdEncryptValue_Click(object sender, System.EventArgs e)
{
txtShowValue.Text = FormsAuthentication.HashPasswordForStoringInConfigFile(txtGetValue.Text, ddlChooseAlgo.SelectedValue);
}
Here the encryted value is dispalyed in the textbox.My problem is to insert the encrypted password value into sql database...Please anyone give me a idea to insert into sql
With Regards,
Samson
|
|
|
|
|
samsonx wrote: Here the encryted value is dispalyed in the textbox
If the value is displayed in the textbox what is the problem for inserting that to database ?
samsonx wrote: Please anyone give me a idea to insert into sql
Create connection using SQLConnection class. Write query in command and call ExecuteNonQuery()
|
|
|
|
|
Hi:
I have created a simple web page and was able to published. Anyhow, I went back and create a master page. How can I tied the rest of the pages onto my master page.
I found most example showed how to create a master page then create a default.aspx then selected master page to attch them together.
Thanks in advance.
Eyungwah
|
|
|
|
|
if u want the master page remain the same for ur entire application,
configure it in ur web.config file in the following way.....
-----<configuration>
<system.web>
<pages masterpagefile="~/MasterPage_DefaultContent.master">
----
or...
if u want this to be master page for some of ur aspx pages then include the Page directive in ur aspx page and assign the master file in the masterfile attribute of the page directive...
mareers
|
|
|
|
|
f u want the master page remain the same for ur entire application,
configure it in ur web.config file in the following way.....
-----
in configuration tag
then system.web tag
in pages tag specify the location of ur masterfile in the masterpagefile attribute
close pages tag
close system.web tag
close configuration tag
----
or...
if u want this to be master page for some of ur aspx pages then include the Page directive in ur aspx page and assign the master file in the masterfile attribute of the page directive...
mareers
|
|
|
|
|
|
how can i open modal and modeless dialouge box in asp.net?
thks.
yesu
|
|
|
|