|
I have menu control declared like the below:
<div>
<asp:Menu...
menu items here
</asp:Menu>
I have 40 menu items. All these are displaying in one line with the horizantal scrollbar is displaying fro the page. How to avoid the horizantal scroll bar? When the width exceeds 100%.
Thanks in advance
|
|
|
|
|
I would recommend you to first calculate the width of page then re-size your menu items accordingly.
OR
show them in multiple lines if you can not resize
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
I have a task of Embeding Image with text.it works fine in Ordinary Asp.Net Page but Ajax.
I have come accross the error"Parameter is not vaid" while converting Physical path of image into bitmap image.I am sending code(Aspx code and class file) with this mail kindly Let me know how to solve this error.
Code:
Aspx Page:
private void WaterImaging()
{
if (!string.IsNullOrEmpty(fuPictureImage.PostedFile.FileName))
{
if (!string.IsNullOrEmpty(txtEmbedText.Text) & !string.IsNullOrEmpty(txtLeft.Text) & !string.IsNullOrEmpty(txtTop.Text))
{
string imagePath = null;
string strFileNameToSave = null;
string fname = null;
imagePath = fuPictureImage.PostedFile.FileName;
fname = Path.GetFileName(imagePath);
strFileNameToSave = Server.MapPath(".") + @"\uploads\watermarkimages\" + fname;
DAMS_Cls_Imaging.EmbedText(imagePath, txtEmbedText.Text, ddlFontName.SelectedItem.Text, ddlFontColor.SelectedItem.Text, ddlSize.SelectedItem.Text, txtLeft.Text, txtTop.Text, strFileNameToSave);
}
else
{
ClientScript.RegisterStartupScript(this.GetType(), "Message", "alert('Enter all the Parameter Values for Embed a Text');", true);
}
}
else
{
ClientScript.RegisterStartupScript(this.GetType(), "Message", "alert('Select Image to perform the Operation');", true);
}
}
Class.cs(File)
public static Bitmap EmbedImage(string imagePath, string imgEmbedPath, string width, string height, string left, string top)
{
Graphics graphEmbedImage = default(Graphics);
//Dim BrushColor As System.Drawing.Brush
string strImagePath = null;
string strTempPath = null;
strTempPath = Path.GetFileName(imagePath);
strImagePath = Path.GetFullPath(imagePath);
Bitmap bmpImage = new Bitmap(strImagePath); \\This is where I am getting Error Parameter not valid"
try {
Image embededImage = default(Image);
embededImage = Image.FromFile(imgEmbedPath);
int iWidth = 0;
int iHeight = 0;
int iLeft = 0;
int iTop = 0;
iWidth = Convert.ToInt32(width);
iHeight = Convert.ToInt32(height);
iLeft = Convert.ToInt32(left);
iTop = Convert.ToInt32(top);
graphEmbedImage = Graphics.FromImage(bmpImage);
graphEmbedImage.DrawImage(embededImage, iLeft, iTop, iWidth, iHeight);
return bmpImage;
}
catch (Exception ex) {
throw ex;
}
finally {
graphEmbedImage.Dispose();
}
}
thanks
suresh
|
|
|
|
|
Would you like a list of all the ways this code could be improved ? There's quite a few. Why would you create strings, set them to null, then reassign them ? Why catch an exception to rethrow it ? What happens if the width/height are not valid numbers ? Why not take them as numbers in the first place ?
And, duh. You're passing the path on the client, and trying to load it, from what I can see. Do you know how to use the debugger ?
Christian Graus
Driven to the arms of OSX by Vista.
"Iam doing the browsing center project in vb.net using c# coding" - this is why I don't answer questions much anymore. Oh, and Microsoft doesn't want me to.
|
|
|
|
|
Hello All,
As one who hasn't done too much with ASP.NET, I was wondering, if any of you would like, if the following is a good logical step to a situation I have:
I have a web form that I will repost with a click of a button. But, want a different panel to show depending on the button pushed. Should I set some sort of variable in the code behind in the button_click event and then check that variable in the "if (ispostback)" flow? Or is there an easier more logical way of doing this.
Any comments are welcome.
|
|
|
|
|
Just change the visibility of your panels or multiview in the button_click event. Or call a function with the visibility logic if you prefer that.
|
|
|
|
|
I guess I was thinking too hard on this. Thanks for the bread crumbs...
|
|
|
|
|
hi
a project i'm going to undertake will require a user system which generates a virtual subdomain for users who register with my site.
For example the user john signs up and is given a subdomain to access his account, john.website.com, which when rendered in the browser will automatically bring up http://website.com/profile.php?username=john or similar.
How can this be acheived? I know it can be done with ISAPI_REWRITE I want to use my code for it.
I work ASP.NET.
tanks.
MK4
modified on Saturday, November 1, 2008 3:13 AM
|
|
|
|
|
AFAIK its more of an IIS and DNS configuration thing and outside the realm of control of your app. Once your app gets the request however, you can look at the domain on which the site is being accessed (from your "default.aspx" maybe or even from an HTTP handler) by inspecting the HTTP headers and appropriately redirect or transfer to another page.
But from looking at the URL that you want to redirect to, it looks like you're using PHP though and not ASP.NET?!
--
gleat
http://blogorama.nerdworks.in[ ^]
-- Number Two's eyes narrowed and became what are known in the Shouting and Killing People trade as cold slits, the idea presumably being to give your opponent the impression that you have lost your glasses or are having difficulty keeping awake. Why this is frightening is an, as yet, unresolved problem. -- HHGTG
|
|
|
|
|
hi
i find a way to do it.
1. DNS must be configured.
like *.example.com IN A 10.10.10.10(the site's IP)
2.IIS must be configured such every request to example.com by every subdomain go through ASP ISAPI
3.A HttpModule must be created to handle those request and convert it to actual address.
LIKE subdomain.example.com ----> www.example.com/query?id=subdoamin.
thanks.
bye.
MK4
|
|
|
|
|
Hi.
I have the same problem .Do you know any online HttpModule sample? I have no idea about it.
regards.
mehran
|
|
|
|
|
i wrote a webmethod that get an specified object and do the manipulation and return a new object which same kind of input object.client call the webmethod passing the oject and another new object is taking the returned object.i used an xsd to generate the class for the object.
but the problem is in the client side the method displayed as void and taking a ref object.
how can i get a new object after passing another object.
|
|
|
|
|
I don't know what you have written in your class. But you should remember object should be serialized. If you can post here your few code like example then we can take more action on it.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
Hi,
I have retrieved the data frm Sql and bind the data to a grid in one page. There is an item template column if checkbox to the same grid. I want the checked rows data to bind to grid in another page.
|
|
|
|
|
Hold all records temporarily in Table on first page and store into the session object. Then again populate it on second page from session.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
Hi all,
quick question how do you center your components in asp.net on the html side of things. I've tried to work it out but am having no luck so go back to using normal HTML tables
Any advice welcome.
Thanks
PS I'm more on the development side of things then designer making things look good
|
|
|
|
|
Where are the add/delete button codes? I want to catch some errors there
|
|
|
|
|
|
What sort of answer is that?
|
|
|
|
|
eyeseetee wrote: What sort of answer is that?
A typical one from him.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
hopingToCode wrote: quick question how do you center your components in asp.net on the html side of things.
Surely HTML is just embedded in an aspx page. Are you struggling to aling a normal HMTL table in the middle of the page, is that query query?
|
|
|
|
|
a normal table in HTMLI can do, but if I wanted to center an asp label with out a table how would I do that? or a
label text box label combo box
on one line in the centre
|
|
|
|
|
generally its with a combination of width and margin or text-align styles.
This div will take up 300px and be centered horizontally.
<div style="width:300px;margin-left:auto;margin-right:auto">
Im in the centre
</div>
this div will be 100% wide but all the text will be centered
<div style="text-align:center">
Im in the centre
</div>
|
|
|
|
|
So I have to do it on a div I can't do it on the control
|
|
|
|
|
Div is the best way to do it.
|
|
|
|