|
I really appreciate your help but i dont think this is a better solution.
I would rather create a public property in the masterpage and cast the masterpage in all my content pages(there are around 40-50 pages).
although it is a tedious work.
I will store the id in the content page's viewstate.
Everything Is Possible!
|
|
|
|
|
But where it will get the Id ... In server side ??
Id should be stored at least somewhere to communicate. Do you think only a property can make things ok. Every time a web request is made a new object of the whole page will be created. If you open a new tab, there will be no communication between the original page(Even session is different)
So it will always hold the default value of the property. Viewstate will be refreshed for every page, so it cant get the values that you created in another page.
Anyways...
thanks for your appreciation. But I am still not sure what you are upto...
Best wishes.
|
|
|
|
|
I will assign the viewstate to the property.
Regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|
|
Create the public property in Master page.
Cast the master page in content page
MasterPage mymasterpage = Page.Master as MyMasterPage;
Use the property in content page to access the customer name.
Response.Write(mymasterpage.CustomerName);
Try it, if it is working
Regards
Aftab Sindhi
.NET Application Developer
U.A.E
|
|
|
|
|
I dont want to make changes in all the content pages because there are around 40-50 pages.It's tedious to incorporate this changes to all the files.
Is there a way by which i have to modify only the master page?
Everything Is Possible!
|
|
|
|
|
how can i rotate an image in image control by arbitrary angles ??
M.Alizadeh
|
|
|
|
|
|
thanks for your help
but it coudnt help me
i want to rotate an image in image control not in a new page...(first link)
seccend is for win app:
pictureBox.Image = Utilities.RotateImage(img,(float) angle.Value );
image has not image properties
M.Alizadeh
|
|
|
|
|
AFAIK, html image control couldnt be rotated. You can define the size of the img but cant rotate.
To do this, you need to rotate the image in the server and produce another image and show it in browser. Use graphics object to draw a new image rotating it in an angle and show it in browser.
This article could be a good help for you :
Image Rotation in .NET[^]
After you rotate the image, show it using img tag.
On the other hand:
If you want to rotate in browser itself, you might use Flash / silverlight which are capable of doing this.
Hope you got this.
Cheers
|
|
|
|
|
|
I think this javascript uses moveto function to actually rotate an image.
Use this Javascript
http://www.walterzorn.com/scripts/wz_rotateimg.js
I think you can do this without Flash and Silverlight.
|
|
|
|
|
Hi, i want to read data from the source file of 3rd party website. The page is not in my control. Here i need to do two things.
a. I just read the html content of that page in to string first
b. and later i want to retrive some specific data from that string.
the first option is ok. The second option i am not getting how to retive the data.
<tr>
<th>First Name</th>
<td width="100%"><input name="p_first_name" type="text" id="f-first-name" value="JEAN" /></td>
</tr>
<tr class="tr-back">
<th class="tr-back">Last Name</th>
<td><input name="p_last_name" type="text" id="f-last-name" value="AAREN" /></td>
</tr>
<tr>
<th>Occupation</th>
<td width="100%"><input name="o_occ" type="text" id="f-occ" value="UNKNOWN" /></td>
</tr>
In the above code i want to retrive the values first name, middle name and lastname. i.e JEAN, AAREN, UNKNOWN
Can any one help me how to retrive this code once reading all this html in to string..? or any other way
|
|
|
|
|
If you are sure that the resultant string is in valid XML format, just load it to XmlDocument and use XPath to get the required values. Other option is to use regular expression and look for the text.
Best wishes,
Navaneeth
|
|
|
|
|
how to load that string in to xmldocument?
G. Satish
|
|
|
|
|
|
If you place a wrapper to all the tr's it will load easily in XMLDocument / XDocument.
Just take the table tag which wrap around all the entries.
Use XElement.Load(your html string) to get the xml loaded.
Now search the elements using Linq to XML.
Cheers...
|
|
|
|
|
Dear all
I want to make a web site as a book on asp.net but the pages are jpg images not text and i can make next >> and previous <<
which controle i can use to navigate through the images in this book
thank u for advice
Kareem Elhosseny
|
|
|
|
|
Just use client side button.
When onclick to button, make an ajax call to the server(might be a dedicated handler) and change the src or img tag.
|
|
|
|
|
thanks my brother
Kareem Elhosseny
|
|
|
|
|
Here is a code project in asp.net.
i have to insert dynamically create rows in a table name : [Pin_Generate]
The number of rows are inserted by the user and then submit and it create that number of rows in that table.
But it cannot be done when its going 2nd time in a loop...
<br />
for (i = 1; i <= Convert.ToInt32(EnterByUserTextBox.Text); i++)<br />
{<br />
getNum();<br />
<br />
scomm1.Parameters.AddWithValue("@pid_no", lblprint_id.Text);<br />
scomm1.Parameters.AddWithValue("@pserial_no", lblserial_no.Text);<br />
scomm1.Parameters.AddWithValue("@ppassword", lblpassword.Text);<br />
<br />
sconn1.Open();<br />
int x = 0;<br />
x=scomm1.ExecuteNonQuery();
sconn1.Close();<br />
<br />
<br />
if (x > 0)<br />
{<br />
<br />
lblmsg.Text = "Successfully Created";<br />
update();<br />
<br />
}<br />
else<br />
{<br />
lblmsg.Text = "Please Try Again";<br />
}<br />
<br />
<br />
}<br />
Plz help me out.... its very urgent..
|
|
|
|
|
Welcome to CodeProject! Please read the forum guidelines[^] to learn how to ask better questions. People here do voluntary help and specifying urgent in the message won't help you to get answers. It is considered as rude.
To answer your question: what error are you getting? What getNum() function is doing?
There are few problems in your code. You are adding parameters in each iteration which is not correct. If you want to insert the same value N times, you don't have to open and close the database connection each time. Open it once, call ExecuteNonQuery() N times and close the connection. Here is the code after few refactorings.
int n;
if(!int.TryParse(EnterByUserTextBox.Text, out n))
{
}
using(SqlConnection sconn1 = new SqlConnection(connectionstring))
using(SqlCommand scomm1 = sconn1.CreateCommand())
{
scomm1.Parameters.AddWithValue("@pid_no", lblprint_id.Text);
scomm1.Parameters.AddWithValue("@pserial_no", lblserial_no.Text);
scomm1.Parameters.AddWithValue("@ppassword", lblpassword.Text);
try
{
sconn1.Open();
for (i = 1; i <= n; i++)
{
scomm1.ExecuteNonQuery();
}
sconn1.Close();
lblmsg.Text = "Successfully Created";
update();
}
catch(Exception ex)
{
lblmsg.Text = "Please Try Again" + ex.ToString();
}
}
Best wishes,
Navaneeth
|
|
|
|
|
Good Answer Navaneeth...
Additionally I have also marked this as answer...
Cheers.
modified on Saturday, November 14, 2009 1:51 PM
|
|
|
|
|
Thanks friend.
Best wishes,
Navaneeth
|
|
|
|
|
hi gents,
In ASP.NET solution file is in Projects folder and project files are in Websites folder. I wanna to put both in the same folder in another location..
I have copied the files from projects folder to the websites folder and its working but when i move the files to some other location its giving error "One or more files cannot be loaded...."
Please help me to find a solution for this
Thanks in advance
Regards
Ahamed Azeem
software Programmer
|
|
|
|
|
Can you please elaborate your question.
Please don't forget to mark 'Good Answer', if you find it really a good one!
Kashif
|
|
|
|