|
|
Hi Guys,
I am using VS2008 ASP.Net 3.5.
I have a masterpage.main where <img id="image1" src="image1.jpg" /> is located.
My problem now is, in my sub page how am I be able to change the src="image1.jpg" to image2.jpg at runtime?
For finding and changing the value of standard image control, I am using this code -
CType(Page.Master.FindControl("image1"), Image).ImageUrl = "~/images/image1.jpg"
But how will I do the same when changing the <img src=#/> value?
Any ideas?
Thanks in advance.
hifiger2004
|
|
|
|
|
|
Hi Mark,
There's an existing codes already being developed by previous developer using an img tag for all images in the master page. If it's only 1 img tag, I wouldn't hesitate to change it to standard Image control.
This is the situation now, so instead of changing all the img tag to a standard Image control I prefer to call the img and change the src value if there's a simple way of making it work.. But I am not sure if how possible, workable, I don't know.
What can you suggest, better just change them all from img tag into the standard Image control, there's no other solution?
Thanks
hifiger2004
|
|
|
|
|
Did you even look at the link I included? You're answer is there.
hifiger2004 wrote: so instead of changing all the img tag to a standard Image control I prefer to call the img
So instead of taking the time to do it right, you'll waste time on work-arounds that may not be useful in the future, in which case you'll again waste time on a work-around. But then I notice the code is VB and this is typical VB mentality.
only two letters away from being an asset
|
|
|
|
|
I have an application that is using a jquery for hover function. However.. before I conplete that function, I want to varify that the file does indeed exist on the server. Is there a jquery out there someplace to do this??
The hover event brings back a large jpg verses the thumbnail.
Thanks
gollnick
Gollnick
|
|
|
|
|
gollnick wrote: want to varify that the file does indeed exist on the server. Is there a jquery out there someplace to do this??
You have to check it before bind the image to client side. If you are using some thirdparty JQuery for doing this then it should have this features too.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
As the page is being rendered you should make the appropriate settings based on whether the file exists or not.
Something like this
if( fileExists )
link.class = "hover";
else
link.class = "no_hover";
only two letters away from being an asset
|
|
|
|
|
Sorry .. let me rephrase this.. I have this code on the page.
<b>RIGHT HERE--->>>>>>> Here is where I want to check the existance of this "BIG" jpg. .... before the popup is thrown... If it DOES not exist I want to show a stock "NOTONFILE" jpg......</b></u>
$("img#popUpImage").attr("src", bigImageName);
$("div#popUpImageBox").modal({ overlay: 80, closeHTML: "close",
overlayCss: { backgroundColor: "#333" }
});
});
});
$("input[ id^='dgCust_ct' ]").mouseleave( function() {
$("input[ id^='dgCust_ct' ]").stopTime();
});
$("input[ id^='dgCust_ct' ]").click( function() {
$("input[ id^='dgCust_ct' ]").stopTime();
});
});
gollnick
Gollnick
|
|
|
|
|
It doesn't change anything, check if the large file exists on the server-side and apply a class to the small image link. In your JQuery, only apply the hover to img tags with a big image class. You're trying to make it much more complicated than what it is, unless I'm missing something, or you're not giving the full story.
only two letters away from being an asset
|
|
|
|
|
Ok ... I have identified which images in the datagrid HAVE a thumbnail and a larger image.
(see the first document)
<table class="grouplist" cellspacing="0" cellpadding="3" align="Justify" rules="rows" border="1" id="dgCust" style="background-color:LightGoldenrodYellow;border-color:#E7E7FF;border-width:1px;border-style:None;width:804px;border-collapse:collapse;z-index: 103; position: absolute;
top: 213px">
<tr align="left" style="color:#4A3C8C;background-color:#E7E7FF;">
<td colspan="4"><span>1</span></td>
</tr><tr style="color:#F7F7F7;background-color:#4A3C8C;font-weight:bold;">
<td> </td><td> </td><td> </td><td> </td>
</tr><tr style="color:#4A3C8C;background-color:#E7E7FF;">
<td>
<p>
<input type="image" name="dgCust$ctl03$Img1" id="dgCust_ctl03_Img1" class="smallImage" src="http://localhost:1488/Web_Swanson_Shopping/Graphics/ALL.jpg" style="height:124px;width:156px;border-width:0px;" />
</p>
<p>
<a id="dgCust_ctl03_lnk1" href="javascript:__doPostBack('dgCust$ctl03$lnk1','')">All Groups of Merchandise </a>
</p>
</td><td>
<input type="image" name="dgCust$ctl03$Img2" id="dgCust_ctl03_Img2" src="http://localhost:1488/Web_Swanson_Shopping/Graphics/AUTO.jpg" style="height:124px;width:156px;border-width:0px;" />
<br />
<br />
<a id="dgCust_ctl03_lnk2" href="javascript:__doPostBack('dgCust$ctl03$lnk2','')">Automobile Parts and Supplies </a>
</td><td>
<input type="image" name="dgCust$ctl03$Img3" id="dgCust_ctl03_Img3" class="smallImage" src="http://localhost:1488/Web_Swanson_Shopping/Graphics/CABLES.jpg" style="height:124px;width:156px;border-width:0px;" />
<br />
<br />
<a id="dgCust_ctl03_lnk3" href="javascript:__doPostBack('dgCust$ctl03$lnk3','')">Cables - big and little </a>
</td><td>
<input type="image" name="dgCust$ctl03$Img4" id="dgCust_ctl03_Img4" class="smallImage" src="http://localhost:1488/Web_Swanson_Shopping/Graphics/ELECTRONICS.jpg" style="height:124px;width:156px;border-width:0px;" />
<br />
<br />
<a id="dgCust_ctl03_lnk4" href="javascript:__doPostBack('dgCust$ctl03$lnk4','')">Electronic parts and supplies </a>
</td>
</tr>
Those WITH a large image have a class
class="smallImage"
The javascript on my page needs to identify which image being hovered over has this class (class="smallImage").
Here is the code I'm trying (and getting very frustrated over)
<script type="text/javascript">
$(document).ready(function(){
$("img#popUpImage").click( function() {
$.modal.close();
$("img#popUpImage").attr("src", "");
});
$("input.smallImage").attr("title", "Hover over to magnify.");
[COLOR="Red"]//trying to make this if statement work right here)[/COLOR]
if ($("input[class=='smallImage' ]"))
{
$("input[ id^='dgCust_ct' ]").hover(function() {
$(this).oneTime( 1500, function() {
// Fetch the image from the current img tag.
var bigImageName = $(this).attr("src");
bigImageName = bigImageName.replace( /\.jpg$/i, "Big.jpg");
$("img#popUpImage").attr("src", bigImageName);
$("div#popUpImageBox").modal({ overlay: 80, closeHTML: "close",
overlayCss: { backgroundColor: "#333" }
});
});
});
}; // added
$("input[ id^='dgCust_ct' ]").mouseleave( function() {
$("input[ id^='dgCust_ct' ]").stopTime();
});
$("input[ id^='dgCust_ct' ]") .click( function() {
$("input[ id^='dgCust_ct' ]").stopTime();
});
});
</script>
help
gollnick
Gollnick
|
|
|
|
|
|
xtplatinum wrote: want to see full project
You won't get it here. We are not here to do your work for you. We will answer questions or point you in a direction, but not give you everything.
As a beginning developer you will gain valuable insight and skills be trying it yourself first, then if you have questions, ask.
only two letters away from being an asset
|
|
|
|
|
Hello,
Can somebode give me some tips on what to search in order to create a flash control and embed it into my asp.net page.
the flash control is a dll file that i can add it to my toolbox ..
regards,
Elie.
dghdfghdfghdfghdgh
|
|
|
|
|
Stop being so damn lazy This is such a simple thing to search for
here[^]
only two letters away from being an asset
modified on Saturday, October 17, 2009 9:20 AM
|
|
|
|
|
I am a beginner to ASP.NET, and am pulling my hair out over this:
I create a website, put a CSS and an image in the root folder, and apply them to the default.aspx page. I can see the image in the design and split views, and I can also see the the style applied to the text. I check the site via CTRL+F5 with the ASP.NET development server, and all is fine: image, style both present and correct.
I create a folder to hold images, and one for styles. I give every folder in the chain a web.config with
<authorization>
<allow users="*"/>
</authorization>
I move the image and the CSS to the respective folders, and reapply the CSS, and delete and re-insert the image. Again, I can see both image and style correctly applied in the design and split views. When I run the website via CTRL+F5, I get a place holder for the image (but it's the right size) and no style applied. Checking the image properties, I get a url of "http://localhost:1087/ANWS1001/App_LocalResources/Images/BalaSignInSquiggle.png" which looks right.
Any ideas?
[edit]
Solved: don't use the "App_LocalResources" or "App_GlobalResources" no matter how much you think it makes sense! Create your own "Resources" directory and hang the images and style sheets off of that. Works fine.
[/edit]
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
modified on Saturday, October 17, 2009 10:16 AM
|
|
|
|
|
Dear All,
I am having an issue. My application (.net2.0/SqlServer2005)is having a strange issue.when i build the application it runs correctly no error no Session value is null. It is redirrected to every intended page. But when i publish the same application and deploy the release its logs in successfully but after that where ever a post back is occured, either by the master page menue or the home page controls, it is redirected to log in page as if some session value is set to null. I have debugged and checked the session value. I am mentainig the session value at login page that is never null and when i run the application it works ok but not when published and deployed. When published and deployed on Windows Server 2003 or local system with Win xp sp2 it runs ok in firefox but not in IE(neither in 8 nor in 6).
Please tell what could be the reason. Remember again no null value in session variables mentained at the log in time.
Thanks
Safvi
|
|
|
|
|
Please reply and help me solve the issue. Its really urgent. Thanks
Safvi
|
|
|
|
|
Have you used Webgarden or Webfarm?
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
Parwej, thanks for the reply. No,I am not using either Webgarden or Webfarm. My application is asp.net2.0 application on iis.
Safvi
|
|
|
|
|
It seems to be your coding issue. If you will post here your code where your setting the session or retrieving the session. One more thing make ensure your session timeout value if sufficient.
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
K.Safvi wrote: . Its really urgent.
Amusingly, it's not urgent to us. You should explain what code is failing, what you've done to diagnose the error, etc. You should certainly keep working on it while you wait for people who are not being paid to help you, to do your work for you.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Did you check the Sessionstate in the web.config file?
set the timeout=30
and also check httpRuntime, try to set the executionTimeout="7200".
I think your application's timout expires or something.
Try this and let me know.
|
|
|
|
|
Hello everybody,
again a question from my side. I've not answered questions here yet, I'm beginner :S
So here we go: I have an ASPX page where you must sign in with Windows Auth. Now I see IE saves my login all the time, but I want to login with an other account. If possible, how can I logout from the Windows Auth?
Thanks in advance!
Madmatt.
|
|
|
|
|
You should switch to Forms Authentication and use the ActiveDirectoryMemebershipProvider.
This link[^] should give you some help
only two letters away from being an asset
|
|
|
|