|
Pals, i have problems to show images on gridview control.
i have the image url saved onto a table columns in Sql server express 2005.
ex C:\Inetpub\wwwroot\intranet\imagenes_usuarios\a\bio.jpg, the column name is urlimage
i created an ImageField inside the gridview, its already set the dataurlimagefield value to urlimage, and the image dont show up.
I lost something, refresh event, or something...
keep Learning and you never will be out of date...
|
|
|
|
|
The obvious question is, are you sure the path is correct? Is it being correctly rendered in the urlimage property (path not image itself, of course)?
only two letters away from being an asset
|
|
|
|
|
I follow your suggest and i found that maybe gridview image colunm doesnt work with absolute url image, what do you think, ¿im right??
an Friend Britney
keep Learning and you never will be out of date...
|
|
|
|
|
I haven't tried it with absolute paths but I have with relative paths and it seems fine.
only two letters away from being an asset
|
|
|
|
|
Absolute paths like this will never work on ASP.NET controls because the browser on the user PC will not understand where is the C drive on the server.
You must convert this path to a relative path. May be by trimming the url string to remove the first characters until the page folder. like:
<%# DataBinder.Eval(Container.DataItem, "urlimage").ToString().Substring(28) %>
The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.
|
|
|
|
|
Hello folks,
I'm implementing the ASP.NET 2.0 App_Global/LocalResources support for Mono and have a problem understanding the workings of the
protected Object GetGlobalResourceObject (
string className,
string resourceKey,
Type objType,
string propName
)
version of the method (defined in TemplateControl). The way I understand it should work is that, given code like:
object obj = GetGlobalResourceObject("Test.strings", "LabelResource1.Font-Name", typeof(int), "Length");
I should get the length of the property named in the second parameter and yet I get a null. At first I thought that the type should be that of the object pointed at resourceKey, but using typeof(string) in the above case throws an exception.
Could anybody, please, shed some light on the workings of the method for me? Thanks in advance!
marek
|
|
|
|
|
Hi there,
The common usage of the method is the first overload with two parameters, the second overload with 4 parameters does 1 further step after retrieving the resouce. It tries to convert the resource result to the type of the property whose name is specified in the 4th parameter and this property is basically defined in the object that is of the type as the 3rd parameter. That said, if you specify the parameters as ...typeof(string), "Length") in the method call, after getting the resouce based on the first two parameters, the method converts the result to the int type as the Length property of the string is int. So you might get the error if the resource cannot be converted to an integer value. However, this overload still does not make much sense to me as I don't see the usage of it, and I'm curious about your thoughts.
|
|
|
|
|
hey there,
My first understanding was that it retrieves some object from the resource, tries to cast it into the type specified as the 3rd argument and then looks whether the result of the cast has the property named in the 4th parameter. If it was so, then the call would make sense for retrieval of objects like bitmaps and getting their dimension in one call, for instance. Another use would be for implicitly setting a control's property, as in:
<asp:label runat="server" meta:resourcekey="LabelPrefix">
Then it would make sense to call this method for properties of Label like Text or ToolTip. Only... implicit resource expression is supposed to work only with local resources (see http://quickstarts.asp.net/QuickStartv20/aspnet/doc/localization/localization.aspx#expressions) - in such instance using GetGlobalResourceObject makes no sense at all.
Looking at the description of the parameters at msdn (http://msdn2.microsoft.com/en-us/library/ms153594.aspx):
<br />
className<br />
A string representing a ClassKey. <br />
<br />
resourceKey<br />
<br />
A string representing a ResourceKey. <br />
<br />
objType<br />
<br />
The type of object in the resource to get. <br />
<br />
propName<br />
<br />
The property name of the object to get.<br />
<br />
Return Value<br />
An object representing the requested resource object; otherwise, a null reference (Nothing in Visual Basic).<br />
it seems the call should return the value of the object's named property cast to the type in the 3rd parameter...
In a word - I'm totally confused with this overload - as you say, it seems to make no sense.
|
|
|
|
|
I have several date fields in an employment application that will be hosted on our intranet at work. The form is set up currently to email the application to our human resources department in HTML format. I'm using a javascript based calendar control that is populating the textboxes correctly. My problem begins when I try to capture that date in the emailed application. They just don't show up at all. I can see the values in the textbox when I click on submit, but when the email is received, the dates just aren't there. Everything else comes across correctly.
Here is what I've got right now (for just two of the dates):
Dim dtmildateto As Date
I tried this formatting from another group's suggestion, but the date always returns "00/01/0001" no matter whether the date textbox is filled or empty.
dtmildateto = IIf(Request.Form("mildateto") = "", DateTime.MinValue, Request.Form("mildateto"))
Then I tried JUST calling the date from the textbox and for these I get an error that says --
"System.InvalidCastException: Conversion from string "" to type 'Date' is not valid" and points to the first line below...
dtmildateto = Request.Form("mildateto")
My append statement is set up as follows:
ebody.Append(dtmildateto & " " & " to " & dtmildateto & " ")
My textbox with the image for the calendar control is set up as follows:
The end result is if the field is populated, I want mm/dd/yyyy as the format for the date in the email; if the field is empty, then I just want so the tables don't lose their formatting.
What am I missing??
Thanks,
Carla
|
|
|
|
|
Add the property name="mildateto" to the text field.
---
b { font-weight: normal; }
|
|
|
|
|
The project I am working on requires that we send encrypted emails. Using 3rd party software like ASPEncrypt is one way to do it but I was wondering if there was something built within .NET that I could use.
Thanks,
|
|
|
|
|
Hi, could someone help me with a regular expression? I'm wanting to match all words, in a block of text, that are longer than 20 characters, and can contain any character/number or ANYTHING from the ASCII set EXCEPT a space or an HTML angled bracket (<>).
For instance http://www.firingsquad.com/media/hirez.asp?file=/games/battlefield_2142_preview/images/04.jpg would match.
Also the word 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' would match...
...but <a href="http://www.firingsquad.com/media/hirez.asp?file=/games/battlefield_2142_preview/images/04.jpg">a link</a> wouldn't because 'a link' is only 6 characters, stuff inside HTML tags (attributes name and values basically) would be ignored.
I'm basically looking for a way to deal with increadibly long words, which force open P and DIVS to the width of the word, and can thus break my HTML layout. I've researched and researched and found there is no way this can be done with pure HTML/CSS alone and needs some server side solution to handle it, so I'm basically looking for a server side solution. If there is a better way to do this then I'd be greatful to know. Thanks!
Sunday Ironfoot
www.dominicpettifer.co.uk (work in progress)
|
|
|
|
|
I'm just adding a feature that's turning out to be more of a bug and a pain in the butt considering there's only ONE thing that keeps it all from working...
This is my third day of using ASP, so don't be surprised if there's a lot i don't know about
So, my question is, how can i use the value of a string (i use "Request.QueryString("grp")" to get the string value) to list (using the For Next loop) the contents of an array in the same name as the value...it seems like VBScript in ASP can handle multiple objects in the same name as long as they are not the same type of an object and that gets in the way...
I'm doing my best to find an answer but i'm not sure if i'm googling for the right thing...
So please suggest something or help me narrow it down to a few tricks that will actually work...
Roswell
"Angelinos -- excuse me. There will be civility today." Antonio VillaRaigosa City Mayor, Los Angeles, CA
|
|
|
|
|
You could use the Eval function to do this, but it's really not efficient, and clearly not safe.
Instead you should rethink what you are doing, and see if there is a better way to do it.
If you need to do it that way, using Select to get the right array is a safe and efficient way:
Select Case Request.QueryString("grp")
Case "dogs": astrList = astrDogs
Case "cats": astrList = astrCats
Case "rats": astrList = astrRats
Case Else: Response.Write "Error: Unknown group." : Response.End
End Select
---
b { font-weight: normal; }
|
|
|
|
|
Thanks...that's exactly what i was reading about just a second ago in the tizag.com ASP tutorial, something i haven't turned to until now... the method looked about right to me so i'm glad to see a more experienced coder suggest it as well...hopefully it will not see an distinction between the value of a string and the value of the array name
Roswell
"Angelinos -- excuse me. There will be civility today." Antonio VillaRaigosa City Mayor, Los Angeles, CA
|
|
|
|
|
RoswellNX wrote: hopefully it will not see an distinction between the value of a string and the value of the array name
Curious about what you mean by that... A value from the query string is always a string. If the contents of the string happens to be the same as the name of a variable, they are still unrelated.
---
b { font-weight: normal; }
|
|
|
|
|
if the two values are equal there's still a chance that it might not identify the array because from what i see VBScript interprets data as objects, and it might still read the string as nothing more than a string even as that is used to select an array by name...
At first i tried to see if it will be able to simply take the value of the query string and use that to select the corresponding array, but i see that it can not take a value of a string and interpret it as the name of an array when used in a function or when generating links. But it works if i simply name the array manually in the For - Next loop.
FYI, he main purpose of the script is to take a query string and identify the array that it corresponds with, containing string values that will be used to generate the links by the For - Next loop)
Roswell
"Angelinos -- excuse me. There will be civility today." Antonio VillaRaigosa City Mayor, Los Angeles, CA
|
|
|
|
|
The value of a string will never be identified as anything in the code. You can put anything in a string, and it won't cause anything to happen. For an example:
a = 42<br />
b = "a = -1"
The variable a still contains the value 42, the string in the variable b is only treated as text.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: The value of a string will never be identified as anything in the code. You can put anything in a string, and it won't cause anything to happen. For an example:
a = 42
b = "a = -1"
The variable a still contains the value 42, the string in the variable b is only treated as text.
yeah, a string is in quotes...that's what makes it look like a string in the system i guess, and what i think my problem is that i somehow let it be classified as a string and keep the quotes, while i want to turn the string value into something of a keyword to pick the right array.
But chances are that 50% of the problem is that i'm wound up and nervous right now, and it makes it that much harder to understand all the material i try to memorize w/o making sense of it beforehand...i remember bits and pieces and i try to compare it to what i know of PHP, but some of it just escapes me
Roswell
"Angelinos -- excuse me. There will be civility today." Antonio VillaRaigosa City Mayor, Los Angeles, CA
|
|
|
|
|
A string literal is written between quotes, but once the string value is assigned to a variable, there are no quotes, it's just a string value. A string is a string, and you can not turn it into an identifier.
You can use the Eval function to evaluate a string as an expression, but I strongly advice against using that. If you evaluate a value from query string without validating it first, your code is wide open for a wide range of attacks. Also IMHO, Eval is Evil. Although it has it's uses in some very rare occasions, mostly it only promotes a backwards way of solving problems.
---
b { font-weight: normal; }
|
|
|
|
|
|
Aside from dealing with UI events (such as OnClick for Buttons) and getting at DataItems in bound controls (such as OnItemDataBound for Repeaters), I'm having a difficult time understanding why one would implement event handlers.
I've spent the last few hours searching Google and the articles and forums in this site, and while I've found plenty of great resources on HOW to implement custom event handlers, I haven't found any that explain WHY I would want to.
For example, one article (in Visual Studio's Help) gave an example of an AlarmClock. The AlarmClock would raise an Alarm event and a listener for that event would execute some code. Why is this model better than simply calling a Ring() method of the AlarmClock class?
Why would this:
protected virtual void OnAlarm(AlarmEventArgs e)<br />
{<br />
AlarmEventHandler handler = Alarm; <br />
if (handler != null) <br />
{ <br />
handler(this, e); <br />
}<br />
}
be better than this:
protected void Ring()<br />
{<br />
}
Any answers (including links to articles) would be very appreciated.
Thanks,
Jorsh
|
|
|
|
|
|
Hello,
First of all let me say I never worked with RSS as a developer.
I am working on a web site where I am displaying news from a database.
This part is done.
Basically, I need to make those same news available as through RSS.
I believe I need to have a XML file available and updated from the
database?
And maybe the database fields should be the same as RSS 2.0 format?
Anyway, could someone advice me on this?
Thanks,
Miguel
|
|
|
|
|
|