|
Hi,
Did you try?
MenuItem menuItem = new MenuItem(lst.MenuName); //creating object of menu name
menuItem.NavigateUrl="~/For_AboutUs.aspx" //[or] Can be a field value
menuitem.Text="AboutUs" //[or] Can be a field value
menuitem.Value="AboutUs" //[or] Can be a field value
menuBar.Items.Add(menuItem);
|
|
|
|
|
solved my problem.. thanks a lot Paramu1973..
|
|
|
|
|
Hi ..
you can add Menu location field in your data base
and call that in your dynamic menu
Example as follows
private void getMenu()
{
try
{
con.Open();
DataSet ds = new DataSet();
DataTable dt = new DataTable();
string sql = "Select * from productGroup_master order by ProductGroupID ";
OleDbDataAdapter da = new OleDbDataAdapter(sql, con);
da.Fill(ds);
dt.Rows.Clear();
menuBar.Items.Clear();
dt = ds.Tables[0];
DataRow[] drowpar = dt.Select("IsActive=1");
MenuItem newMenuItem = new MenuItem();
foreach (DataRow dr in drowpar)
{
newMenuItem = new MenuItem(dr["ProductGroupShortName_EN"].ToString(),<a href=""></a>[<a href="" target="_blank"></a>] dr["ProductGroupID"].ToString());
menuBar.Items.Add(newMenuItem);
newMenuItem.NavigateUrl = dr["MenuLocation"].ToString();
}
con.Close();
}
catch (Exception we)
{ }
}
|
|
|
|
|
thanks for the answer Priyanka Bhagwat..
|
|
|
|
|
Hi, after to may places, I came here to clear my wavering mind..because this is the
place which helped me in many areas...
My requirement is to update the updatepanel image after doing the round corner image works...
Also without roundcorner image functions, it's working fine...But Iam looking to update the
updatepanel after doing the roundcorner image functions..
My Codes..
protected void Timer1_Tick(object sender, EventArgs e)
{
NameValueCollection MyImgList = new NameValueCollection();
MyImgList.Add("Img1", "~/MyImages/Picture1.jpg");
MyImgList.Add("Img2", "~/MyImages/Picture2.jpg");
MyImgList.Add("Img3", "~/MyImages/Picture3.jpg");
Random Rnd = new Random();
int Indx = Rnd.Next(0, 4);
//Image1.ImageUrl = MyImgList[Indx].ToString();
// ********** Until here working fine...***************
//Round Corner Image works...
string path = Server.MapPath(MyImgList[Indx].ToString());
int roundedDia = 50;
using (System.Drawing.Image imgin = System.Drawing.Image.FromFile(path))
{
System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(imgin.Width, imgin.Height);
Graphics g = Graphics.FromImage(bitmap);
g.Clear(Color.White);
Brush brush = new System.Drawing.TextureBrush(imgin);
FillRoundedRectangle(g, new Rectangle(0, 0, imgin.Width, imgin.Height), roundedDia, brush);
// done with drawing dispose graphics object.
g.Dispose();
// Stream Image to client.
Response.Clear();
Response.ContentType = "image/pjpeg";
bitmap.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
Response.End();
// dispose bitmap object.
bitmap.Dispose();
}
Image1.ImageUrl = ?????? how to mention here ?
Because the confusion is image get disposed ????
}
Thanks for the guidances
|
|
|
|
|
You have to write the image to the disk drive, and then call the URL path for it.
In the old days, when I was using PHP, we wrote the image to memory, and used webpage to hold the memory stream, and then called the webpage URL to substitute as the image file.
But if yo wrote a multi user system, then everyone may get the same image, if used at the same time, so now you have to do some work with unique image names.
Why not just make the round corners a head time at just use them?
I think you can make a round corner canvas, and place your image over the canvas, and save the combined images.
|
|
|
|
|
Hi guys,
I am using the latest Dotnetnuke (DNN 7.0), i want to remove the bootstrap from that.
How can do it.
|
|
|
|
|
Hi all!
sorry for my english!
that's what i need:
i'm creating an asp.net project whith VS2008:
client calls dostuff.bat file on web server
dostuff.bat:
java.exe arguments...
the java command elaborate srcFile.xml in srcFolder
and create destFile.pdf in destFolder
i'm tryng to call dostuff.bat with process.start
it runs on local machine but not on web server!
what's the best way to solve it?
what about by create dostuff.asp to run java command?
PLEASE HELP!!!
|
|
|
|
|
ianoseb wrote: client calls dostuff.bat file on web server
Oh no, that's not how web applications work. Start with basics: create a static web site, then have an application create the contents of the static pages, etc. Learn step by step, and always make sure that you understand what you do.
|
|
|
|
|
I have made a login-page and have users.
Is there a way to see what password the user have?
It doesn´t seem to show when you click "manage users".
|
|
|
|
|
There a lot of methods to using login..
Some use active dr, some can be stored in the database..
I am sure you can get their password but a better question is should you ?
I would say prob not, instead build a way for them to reset it and you too reset it... best not to care what their password is, as long as follows your security rules.
=)
|
|
|
|
|
You should never be able to see users password, if you do, so will others do. Have the rights to reset as suggested. Anyways, why do you want to see them?
I remain joe!
|
|
|
|
|
The thing is that I am teaching a class and would like the students to be able to see what password they have chosen.
Then again I only have to make sure that they write the passwords they choose.
|
|
|
|
|
Use a select statement and bind to the data to Grid... I still believe that seing passwords is wrong, people have to memorise their passwords, have an option to reset it and a forgot password option... I always encrypt my passwords - seing them will not make a difference. Hope that you are sorted.
I remain joe!
|
|
|
|
|
Please don't do that I don't know what age your students are but in my opinion even the youngest kids should know that their passwords are personal and should not be shared nor written.
If I recall correctly the asp.net application by default stores passwords as hashes, so without altering configuration you won't be able to read them. Like the others suggested, please just implement reset password.
--
"My software never has bugs. It just develops random features."
|
|
|
|
|
My students are about 16-20 years.
I think I will take your advice
Thanks!
|
|
|
|
|
larsp777 wrote: The thing is that I am teaching a class Teaching them the wrong things is really not helping. Maybe you should take some more classes first.
Veni, vidi, abiit domum
|
|
|
|
|
Richard MacCutchan wrote: Teaching them the wrong things is really not helping. Maybe you should take some
more classes first.
What do you mean are the wrong things?
|
|
|
|
|
larsp777 wrote: The thing is that I am teaching a class and would like the students to be able to see what password they have chosen.
Need I say more?
Veni, vidi, abiit domum
|
|
|
|
|
Richard MacCutchan wrote:
The thing is that I am teaching a class and would like
the students to be able to see what password they have chosen.
Need I say more?
Well, although I´m not a superexpert in the subject I think it´s a valid question. The answer seem not to be a simple one either given the answers.
What I wanted to know was if you in a simple manor could view the passwords if the students forgot them.
I really don't know what you mean by "teaching them the wrong things."
If there is a way to view the passwords if you are administrator and I show them that then it is really a question of policy and not a technical one. So how would it help me to take a class?
|
|
|
|
|
If there was a way to view passwords on any system, then that system's security is compromised. As a teacher of IT you really should understand that.
Veni, vidi, abiit domum
|
|
|
|
|
Richard MacCutchan wrote: If there was a way to view passwords on any system, then that system's
security is compromised. As a teacher of IT you really should understand that.
And I should take a class to learn that?
|
|
|
|
|
Hello
I need a very basic example on how you achieve this,please do not add any reference links.i checked every link which is available on code project and google.
They may be correct but the thing is i was not able to achieve it
so any simple program and explanation on how this can be achieved would be great
Chandra Sekhar
|
|
|
|
|
Chandra Sekhar.bs wrote: They may be correct but the thing is i was not able to achieve it If you are talking about CodeProject articles, then there is a forum at the end of each article which allows you to ask the author. If you are talking about your own implementation then show what you have done, explain what is not working, and people will try to help you.
Use the best guess
|
|
|
|
|
I created asp.net website who is holding a login page,
Here is the code behind of my login page
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using DbProjectLibrary;
public partial class Login : System.Web.UI.Page
{
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString.ToString();
DBClass db = new DBClass();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void loginbtn_Click(object sender, EventArgs e)
{
string type="Admin";
string get_login = "select * from login where Type='" + type + "'";
DataTable dt = db.get_data(get_login, type, constr);
//gview.DataSource = dt;
//gview.DataBind();
string user = usertxt.Text;
string pass = Passwrdtxt.Text;
string username = dt.Rows[0][1].ToString();
string password = dt.Rows[0][2].ToString();
if (username == user.ToLower() && password == pass)
{
Session["login"] = username;
Response.Redirect("~/Profiles/Default.aspx?type=Admin");
}
else
{
errlbl.Text = "You are not authorized to login";
}
}
}
when i run this code using vs 2012 than it runs perfectly
but when i publish it online and try to run it through iis than it shows that error
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0246: The type or namespace name 'DBClass' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 9: public partial class Login : System.Web.UI.Page
Line 10: {
Line 11: DBClass db = new DBClass();
Line 12: protected void Page_Load(object sender, EventArgs e)
Line 13: {
can anyone help me with it
|
|
|
|