|
|
Hi all
I can only set theme at content page but at master page can not set the theme.
Thank you.
|
|
|
|
|
Do you mean you are trying to add the theme property to the masterpage directive? Then no, this is not supported. You can set the theme in the pre_init for any page, including a masterpage.
only two letters away from being an asset
|
|
|
|
|
Actually masterpage cant be called without content page. It is just a wrapper of every content page.
If this is ur requirement, you need to do this programmatically. Best is to create separate basepages(A class that is derived from Page) for your page. Just apply your theme on the Pre_Init of the page.
|
|
|
|
|
Hello Every body,
I need Asp.net templates for website contianing blog in it. I want to create a website in Asp.net.
Help Appreciated...
|
|
|
|
|
You've made many mistakes here. First, you tell us it's urgent. It's only urgent for you, not us. Second, your subject line is meaningless. Everyone who posts here wants ASP.NET help. Third, you don't want ASP.NET help at all, you just want someone to give you source code. Fourth, you seem to think that if someone gave you source code, you'd be creating a website in ASP.NET. Fifth, you think that we're all standing by, waiting to do all your work for you.
There's a jobs section on this site, you can pay for an ad to find someone to work for you. Otherwise, you have to work for yourself and ask specific questions when you get stuck in your work.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
In my page, I am usign a treeview. For some purpose i need to enabled and disable the treenodes. While disabling the treenode, I use the following code to change the text:
treenode.ChildNodes[i].Text = "<font color = Gray>" + treenode.ChildNodes[i].Text + "</font>";
while enableing, I put Black instead of Gray.
However, while viewing the page, it was Gray always. When I debugged, it is assigning both the color as follows:
treenode.ChildNodes[i].Text = "<font color = Black><font color = Gray>" + treenode.ChildNodes[i].Text + "</font></font>";
How to remove the grey colour while assigning the black color? Please help.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
I think there is no option for this in the Treeview Control. You need to extend the Treeview control and then override the RenderPreText to apply color.
|
|
|
|
|
|
Hi all i need a small help regarding gridview.
I will show some information on loading a page. When ever a user clicks on Edit or delete it should redirect to a login page. Only the login user can edit or delete the data. How can i do this.
|
|
|
|
|
By checking whether user is logged in or not on edit & delete click.
|
|
|
|
|
Can i have the sample code
|
|
|
|
|
Sure, but first tell me, what are you doing for Login functionality?
|
|
|
|
|
Just a basic login like this
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection Con = new SqlConnection(ConfigurationManager.AppSettings["sqlcon"]);
SqlCommand cmd = new SqlCommand();
cmd.Connection = Con;
string sql;
sql = "Select *from login where uname='" + TextBox1.Text + "' and pwd='" + TextBox2.Text + "'";
cmd.CommandText = sql;
Con.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
Response.Redirect("Default.aspx");
}
}
|
|
|
|
|
This is not a proper Login.
You need to use either Session Variables or FormsAuthentication Class.
For more details, please use Google.
|
|
|
|
|
OH Great..!
First Try to read a good book..!
Did You Know abt forms authentication..!First try to read abt forms authentication..!
check the
protected void ConfirmDataGrid_ItemCommand(object sender, DataGridCommandEventArgs e)
{
if (e.CommandName ="edit")
{
}
}
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Are You Using Sessions or forms authentication..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hey i just write it for sample. I know form authentication and other . Please provide me what to do after log in success.
|
|
|
|
|
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ViewState["Loginerrors"] = 0;
}
}
private bool validate(String Uname, String Pwd)
{
bool val = false;
SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings["sqlcon"].ToString());
string qry = "Select Uname, Pwd FROM login";
SqlCommand cmd = new SqlCommand(qry, con);
SqlDataReader dr;
con.Open();
dr = cmd.ExecuteReader();
while (dr.Read())
{
if ((Uname == dr["Uname"].ToString()) & (Pwd == dr["Pwd"].ToString()))
{
val = true;
}
dr.Close();
return val;
}
return val;
}
protected void Login1_Authenticate(object sender, EventArgs e)
{
if (validate(Login1.UserName,Login1.Password))
{
Login1.Visible = false;
Label1.Text = "Success";
}
else
{
Label1.Text = "Failed";
}
}
}
Is this code efficient for login
|
|
|
|
|
Hi all,
I have checkboxes in datagrid to select and a delete button outside the datagrid to delete the checked row in datagrid. After checking the check box and clicking the delete button, in the btndelete_Click im finding the check box in the datagrid and deleting the particular record, but im getting the checked false in the btndelete_Click of the datagrid checkbox which is checked. Please tell me why it is so and how can i find the checkbox of datagrid is checked or not in button click. The code is below:
protected void btnDelete_Click(object sender, EventArgs e)
{
foreach (DataGridItem DemoGridItem in grid.Items)
{
CheckBox oCheckbox = (CheckBox)DemoGridItem.Cells[1].FindControl("chkDelete");
HiddenField hidImageName = (HiddenField)DemoGridItem.Cells[1].FindControl("hdnItem");
if (oCheckbox.Checked == true)
{
try
{
Delete code;
}
catch( Exception e)
{
}
}
}
}
Thanks in advance for ur help.
|
|
|
|
|
The real question is, where do the checkboxes come from ? Best guess, your page load is binding to the datasource and erasing any selected items.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I have created menu from scripting using
|
|
|
|
|
if You are using forms authentication use this
if (Page.User.Identity.IsAuthenticated)
{
}
or if You are using session check the session
If this is not your answer Sorry..!
Then be More clear..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
thnks for ur reply bro...............but i think u r not getting my question..........i hav created menu in html using UL tag,LI tag, and ANCHOR tag with scripting...............in this condition how to check .......
|
|
|
|
|
I have 2 questions for this.
1)Why would you go for html tags rather than using Navigation control in asp.net.
2)How You are checking for particular user whether he is logged in or not..!
KhandelwalA wrote: i hav created menu in html using UL
Then You are redirecting to particular page .Check the login condition.
But IMO Its not good.
But If you are using forms authentication . forms authentication will take care of it..!
Thts the advantage of forms authentication.
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|