|
1. I'm trying to decode the viewstate on my side in an online decoder but I keep getting the
message the string is invalid even though the encryption is disabled. (I also tried it in another encoder)
2. When I disabled the viewstate on the page level, I keep seeing it in the rendered HTML - why
|
|
|
|
|
|
I solved the riddle of the viewstate - I had the 'form' tag with a runat attribute so that was the
only thing that kept the viewstate.
About the decoding thing - I tried to removed the last character (= sign) but it still doesn't work.... strange
|
|
|
|
|
I have a method that I call on page load that iterates through the rows in a gridview. What I would like to happen is for a header row to be inserted when the 'SectionID' of the row changes (it is a data key.)
There will be 6 additional header rows inserted and my code is doing just that except it is inserting all of the additional rows at the top (under the original header and before the first data row.) I want it to insert when the 'SectionID' changes.
Here is my method:
protected void addHeaders() {
foreach (GridViewRow row in GridView1.Rows) {
if (row.RowType == DataControlRowType.DataRow) {
tmpSectionID = GridView1.DataKeys[row.RowIndex].Values["SectionID"].ToString();
if (sectionID != tmpSectionID) {
sectionID = tmpSectionID;
GridView gvw = (GridView)GridView1;
DataRowView drv = (DataRowView)row.DataItem;
GridViewRow HeaderRow = new GridViewRow(-1, -1, DataControlRowType.Header, DataControlRowState.Normal);
Table tbl = row.Parent as Table;
Table myTable = (Table)GridView1.Controls[0];
TableCell HeaderCell = new TableCell();
HeaderCell.ColumnSpan = this.GridView1.Columns.Count;
HeaderCell.Style.Add("font-weight", "bold");
HeaderCell.Style.Add("background-color", "#22539B");
HeaderCell.Style.Add("color", "white");
HtmlGenericControl HeaderSpan = new HtmlGenericControl("span");
HeaderCell.ToolTip = "Tooltip Here";
HeaderSpan.InnerHtml = "Inserted Row";
HeaderCell.Controls.Add(HeaderSpan);
HeaderRow.Cells.Add(HeaderCell);
myTable.Rows.AddAt(1, HeaderRow);
}
}
}
}
|
|
|
|
|
I have created a dynamic menu using sql. the c# code for is shown below:
private void GetMenuData()
{
foreach (UsmMenuControl lst in lstUsmMenuControl)
{
if (lst.ParentId == null)
{
MenuItem menuItem = new MenuItem(lst.MenuName); //creating object of menu name
menuBar.Items.Add(menuItem);
AddChildItems(menuItem, lst);
}
}
}
the aspx code for the menu is:
<asp:Menu ID="menuBar" runat="server" Orientation="Horizontal" Width="100%" MaximumDynamicDisplayLevels="10"
BorderColor="#6699FF" BorderWidth="1px"
onmenuitemclick="menuBar_MenuItemClick">
</asp:Menu>
Now.. what I want is the code to open the respective pages when user clicks on items of menu.. How can I do it?? Can any one help me???
|
|
|
|
|
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?
|
|
|
|