|
I want to increase size of imge button at run tim but ,
i did not able to do it
pls tell me how to do it
my code is
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ImageButton1.Height=ImageButton1.Height+ 120px
ImageButton1.Width=ImageButton1.Width+120px
End Sub
Private Sub ImageButton1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
Private Sub ImageButton1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
End Sub
End Sub
|
|
|
|
|
The Height and Width properties here are Unit types, for which the addition operator is invalid... but I'm not sure that's the way you would want to set them anyway.
I wrote some code to try this and I think Height and Width are being ignored in this context. The following did work (but I have to wonder if there is a better way). It's in C#, but you should be able to follow what's going on. It uses a Session variable to track the current size and increases it on a click of the image. The size is then assigned directly to "height" and "width" attributes (rather than relying on Height and Width properties of the ImageButton).
<% @Page Language="C#" %>
<script runat="server">
const int kDefaultSize = 32;
int GetImageSize()
{
if (Session["imagesize"] == null)
SetImageSize(kDefaultSize);
return Convert.ToInt32(Session["imagesize"]);
}
void SetImageSize(int amount)
{
Session["imagesize"] = amount;
}
void Page_Load()
{
if (!IsPostBack)
{
SetImageSize(kDefaultSize);
ImageButton1.Attributes["height"] = kDefaultSize.ToString();
ImageButton1.Attributes["width"] = kDefaultSize.ToString();
}
}
void BtnClick(object o, ImageClickEventArgs e)
{
int i = GetImageSize();
i = i + kDefaultSize;
SetImageSize(i);
ImageButton1.Attributes["height"] = i.ToString();
ImageButton1.Attributes["width"] = i.ToString();
}
</script>
<html>
<head>
<title>Growing Image</title>
</head>
<body>
<form runat="server">
<p>Click the image to see it grow</p>
<asp:ImageButton id="ImageButton1" runat="server" OnClick="BtnClick"
Src="/help.gif"
/>
</form>
</body>
</html> See if this helps give you some ideas.
|
|
|
|
|
|
Hi
I am trying to get simple HTML formatted text on an image.
I am using FreeTextBox to get the formatting.
How would I keep the formatting and put it on an image?
Or where can I find more information on this and I have spent weeks trying to get this working and can not seem to find anything like this.
Thank you
|
|
|
|
|
Hi there. "formatted text on an image" can mean a few different things to me. Is it that you want to use the GDI+ drawing methods to create an image? or is it that you want to use CSS absolute positioning to place the text element on top of the image element in your HTML web page? or something else?
|
|
|
|
|
hi
say i have:
<code><font color="#000000" size=4>testing <strong>this</strong></font></code>
i want it on an existing image, but exactly as the text would appear in say internet explorer.
...or if i can get a free drawing component for asp.net which "the user" can load the image as a background, and then enter the text in graphics, and save it onto the server...
i have a little image. a user select the image and need to enter information and then it has to be saved on the background as an image...but i need it to be formatted (as described above) as the user wants it...
thank you
pieter
|
|
|
|
|
Hi there. Well, here's one way. It uses a table cell with CSS style elements to set the background image, placing the text in the middle.
<html>
<head>
<title> Positioning with a Table</title>
</head>
<body>
<form runat="server">
<table border="1">
<tr valign="middle">
<td align="center" width="200" height="200"
style="background-image: url(/help.gif);
background-repeat: no-repeat;
background-position: center;
">
<code><font color="#000000" size=4>
testing <strong>this</strong>
</font></code>
</td>
</tr>
</table>
</form>
</body>
</html>
|
|
|
|
|
hi
thank you, but i think i did not make myself very clear. it has to be saved as an image. ie. you must be able to open test.jpg in a paint program and see the formatted text as part of the image. it must be asif you used a text tool in, say, photoshop. when you save it, it has to be part of the image, not text anymore...
thank you
pieter
|
|
|
|
|
|
Hello, I want to create a simple asp page to be rendered on a mobile device (PDA). How can I get to see the size of the page in bytes or something so that I create as light pages as possible because I will be usign GPRS technology to connect to the website and it needs to be very light. Thanx!
Jus Mee
|
|
|
|
|
Load the page in a browser, save the html file to disk and then look at the file properites...
|
|
|
|
|
Hi everyone,
Can we bring a third party tool.Say,Accrobat reader in the browser.I will give a small table or something in the webpage and I have to load the application (Accrobat reader) over here.Is this possible.
Thanks
|
|
|
|
|
Acrobat Reader would have to be installed on the client, which probably wouldn't be an issue as most folks have it installed already. You could try using an <IFRAME> tag where you want your table to be in your web page, then set the source to the .pdf file.
|
|
|
|
|
If you are trying to display a pdf, acrobat reader should run automatically (if installed)
|
|
|
|
|
Infact I want to bring a third party pictureviewer tool.If its already been installed in the client machine,how could it be brought into a frame of the browser.
Can we use the <object> tag of HTML.If so how can we give the classID,Codebase etc .. as I have only the exe of the tool.I tried to bring acrobat reader in the browser by giving its path as classid variable.But it didnt work out.
Now,The question is, can we load an exe in the browser.Say,like acrobat reader has been loaded in a particular portion of the browser and from there its used to open a pdf file,as like normal acrobat reader
|
|
|
|
|
Hi........
it show error login failure in asp.net.
CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.
i didnt yet use crystal report.
i download the demo code and run.
where i fill this , how i know which table field r used for filling report?
i change only
crReportDocument.SetDatabaseLogon("sa", "sa", "user","analysis")
help me plz
with regards
sumi
reply soon
|
|
|
|
|
sumathi_k wrote: where i fill this , how i know which table field r used for filling report?
I'm sorry. This makes no sense to me.
sumathi_k wrote: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.
If your login is failing, it is most likely due to an invalid username/password issue, unless Crystal Reports is using windows authentication, in which case you would want to make sure the ASP.NET process account user has rights to run the report.
|
|
|
|
|
you have to set uo the LogonInfo class correctly
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
|
I have a Problem with this subject. I made a program using asp.net to load a word file. But i can't load it using Microsoft Word 10.0 Object Library in Com Preference. The program running but when it go to this code:
Private wordapp As Word.ApplicationClass
wordapp = New Word.ApplicationClass()
it always have the error:
"ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true">, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access."
I think someone have a file wordapplication.dll that uses good with this problem.
Please help me. Thanks a lot. My email address: aeriscute@yahoo.com
Hanh Aeriscute
|
|
|
|
|
Hi Hanh,
The ASP.NET process identity (the ASPNET or NETWORKSERVICE account) does not have the permission to activate the Word COM object, in this case you need to use the DCOMCNFG tool to grant the permissions. Also, you need to carefully consider using the Automation at the server side as there are a couple of problems which you can find in the documents below. Instead, you may consider using a third-party component like Aspose.Word which supports working with the Word document without using the Automation.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;288367[^]
http://support.microsoft.com/kb/257757/[^]
|
|
|
|
|
very good advice
|
|
|
|
|
"Big" Mike's compliments are always my pleasure .
How are you? You still keep us waiting for your next great article in the ASP.NET 2.0
|
|
|
|
|
minhpc_bk wrote: "Big" Mike's compliments are always my pleasure
Big? Well, I guess I have gained some weight...
minhpc_bk wrote: How are you? You still keep us waiting for your next great article in the ASP.NET 2.0
Doing good, but busy! Hey, for that matter, you're keeping us waiting for yours!
|
|
|
|
|
Mike Ellison wrote: Big? Well, I guess I have gained some weight...
Is it good for you if you have gained some weight, Mike ? In fact, I mean your name is really "big" (well-known) here at CodeProject !
|
|
|
|