|
Your variable strimage returns correct path?! It seems to me that isn't correctly initialized.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
|
whats this..?
Dim strimage As String = "~/SchoolFeeCollection_lalit1/Photos/JC001924.jpg" '"~/Photos/" & photo
the easy way to find the path is to ..!
drop an image control and go to properties set the image url to the image which is stored in the folder..!and copy the path from the source which will generate by VS..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
I might be missing something blindingly obvious here but you don't need to call Server.MapPath when setting an image url. Server.MapPath will give you the physical location on the server disk which is useless when the web page is sent to the client.
|
|
|
|
|
Server.MapPath will return the actual physical path which wont work as an image url. If you want to generate the virtual path at run time use Page.ResolveClientUrl method instead.
"Never put off until run time what you can do at compile time."
- David Gries, in "Compiler Construction for Digital Computers", circa 1969.
|
|
|
|
|
Hello there
I've a website that allows a user to create and download a document. I first save the file in the server and then let the user download it. This works just fine. But when multiple users try to do this, they must create their own copy of the file in the server. Can somebody suggest a foolproof way of naming the file - so that everyuser downloads only their copy of the file.
Many thanks in advance.
|
|
|
|
|
One of possibilities is:
string uniqueFileName = Guid.NewGuid().ToString();
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
Hey Guys, Happy newyear. Just came back from the vacation and am glad to see so many replies. Many thanks for all of you.
I guess I will settle down with GUID.
tahnks once again, Blue_Boy.
|
|
|
|
|
You are welcome, I'm glad to help you.
Happy new year to you too.
Year happy = new Year(2010);
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
How about naming the file with the username as a part of it?
Or possibly a date-time-string such as 'yyyyMMddHHmmss' or a combination of the two?
Nah... What's up, Doc?
CCC's solved : 1
If a bus station is where a bus stops, and a train station is where a train stops, why do I have a work station on my desk?
|
|
|
|
|
Of course.. Pad the UniqueID(Preferably a GUID) just after the actual filename. It will identify which users copy of the file it is.
Also, if your requirement is only to have a copy, why dont you use Database as file storage. It is easier to manage files in database as far as your reqirement is concerned. Only a single row with UserID Foreign key will do the job for you.
Also, another thing, if the file wouldn't be modified by each user in the server, you dont have to store multiple copies of each file.
|
|
|
|
|
To Resolve this you can have a Small Function that will check if the File Exists , if so tell the user else create the File. Let the user be in control of the naming. This will make things easier for them because they will remember the names. Just add a Control Mechanism to check if the File exists with that name, if it exist Suggest another name.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
How to change the Legend Colour in SSRS. I need combination which are not there in Palatte
|
|
|
|
|
Just paste the color code it will work..!
like "#e9e9e9".It will work..!
If this is not your answer let me know..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
hi all,
on clicking a button i am getting a following error:
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or
<%@ Page EnableEventValidation="true"
%> in a page. For security purposes,
this feature verifies that arguments to postback or
callback events originate from the server control that
originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to
register the postback or callback data for validation.
can any body guide me.......plz...
|
|
|
|
|
i set EnableEventValidation="false" in page directive and get solution to my prob...........
|
|
|
|
|
|
|
I have used the option of the better methods from this document http://msdn.microsoft.com/en-us/library/system.web.ui.sessionpagestatepersister.aspx[^]
PageStatePersister _pers;
protected override PageStatePersister PageStatePersister
{
get
{
if (_pers == null)
_pers = new SessionPageStatePersister(this);
return _pers;
}
}
Everything works great, the viewstate is no longer on the page and is moved to session. But how does this get released from the session. I don't see it released and my servers cpu memory is growing indefinetely.
Thanks,
Tilak
|
|
|
|
|
Who told you that using SessionPageStatePersister is a better technique to hold page data.
I think it is better to have viewstate in hiddenfield using HiddenFieldPageStatePersister which is default. I think Everyone here will accept this(Even microsoft do think this, thats why they placed it as Default)
Using excessive session is not a good idea. Actually Session is cleared only when Session TimeOuts, or you manually clear the Session during Logout Request / or anywhere. PageStateAdapter can just refresh the Session Page state on every request.
Dont load lots of Data in one single Application Pool. This will endanger your site if large no of request is made to the site.
If possible, try to minimize the Viewstates transferred to the page.
|
|
|
|
|
The idea here is eventually to move the session to sql server in a load balanced enviroment. Having the viewstate on the page is breaking in a load balanced enviroment.
Thanks for your reply
-Tilak
|
|
|
|
|
Well... moving Inprocess session to StateServer will make your site 10 - 25% slower. Storage of Complex DataTypes will make it even slower.
Normally we do this when we have multiple servers for the same site, which makes it impossible to have session in one process.
So if you are not having multiple web server, storing viewstate to SQL server will reduce performance...
|
|
|
|
|
Hi Abhi,
Exactly the point, we are trying to loadbalance our website to a web farm architecture and don't want the viewstate on the page.
Also most of our screens are transactions which are carrying a viewstate of around 300k on an average and use a lot of partial postbacks and we are looking at options of minimizing data turnaround on each postback(partial or full) between the client and server as the server is planned to be sitting in a remote location in India. So I tried the above approach and got stuck at a point the session grows indefinitely, although eventually I plan to move the session to sql server but wanted to close this minor yet critical hole in the design. I was also thinking when they have an object made available like that they would have taken care of this memory release and may be I am missing something and the answer would be staight forward, but apparently not.
Although viewstate serialization and transfer can put additional burden of 10 to 25% as you said, in my case I want to explore this option, as each partial postback is taking seconds to process when the server is remote as opposed to local which is way faster.
Do you know any good performance test tools which will be helpful in my case above.
Thanks and really appreciate your time,
Tilak
|
|
|
|
|
Yes... There are lots of Tools available. The one that I like the most is Fiddler.
http://www.fiddler2.com/fiddler2/version.asp[^]
You might take a look into it.
Yes, you can modify the page with maximum nos of partial postbacks to make the calls smaller.
Also if you create your form dynamically in the client side without the viewstate and pass to an HTTPHandler, it would remove unnecessary postback data as well.
You might also go for Client Cache for scripts/images/ css etc, and Also few data caching which is required for every call to improve the performance of the page(You might use Cache server to hold your cache).
Finally GZip / Deflate compression makes the request/ response smaller.
You might take a look into my article to have an idea:
Compress Response and HTML WhiteSpace Remover[^]
You can see how the performance is increased in fiddler tool.
Cheers.
|
|
|
|
|
Hi ,
We are trying to implement Java WebService in .Net . But getting error like
An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.
We registerd the security certificate everything but still getting this issue .
The issue what we found is we are getting X509IssuerSerial alias: null in xml request generated by .Net application
Can any one please guide how to sort out this issue.
the app.config is as follows
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<client>
<endpoint address="http://localhost:1919/testWs/services/HelloWorld"
behaviorConfiguration="ClientCertBehavior" binding="customBinding"
bindingConfiguration="JavaInterop" contract="localhost.HelloWorldPortType"
name="HelloWorldHttpSoap12Endpoint">
<identity>
<dns value="YALAMANCHILI" />
</identity>
</endpoint>
</client>
<bindings>
<customBinding>
<binding name="JavaInterop">
<security defaultAlgorithmSuite="Basic128Rsa15" allowSerializedSigningTokenOnReply="true"
authenticationMode="MutualCertificate" requireDerivedKeys="false"
securityHeaderLayout="Lax" includeTimestamp="true" messageProtectionOrder="EncryptBeforeSign"
messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
<issuedTokenParameters keyType="AsymmetricKey">
<issuer address="" binding="customBinding" bindingConfiguration="JavaInterop" />
<issuerMetadata address="">
<identity>
<certificateReference x509FindType="FindByIssuerName" isChainIncluded="false" />
</identity>
</issuerMetadata>
</issuedTokenParameters>
<localClientSettings detectReplays="false" />
<secureConversationBootstrap defaultAlgorithmSuite="Basic128Rsa15"
allowSerializedSigningTokenOnReply="true" authenticationMode="MutualCertificate"
requireDerivedKeys="false" securityHeaderLayout="Lax" messageProtectionOrder="EncryptBeforeSign">
<issuedTokenParameters keyType="AsymmetricKey" />
</secureConversationBootstrap>
</security>
<textMessageEncoding messageVersion="Default" />
<httpTransport />
</binding>
</customBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="ClientCertBehavior">
<clientCredentials>
<clientCertificate findValue="f1 88 d8 95 76 76 5b be 74 53 90 92 fc cf 16 e0 67 5e 4d 34"
storeLocation="CurrentUser" storeName="My" x509FindType="FindByThumbprint" />
<serviceCertificate>
<defaultCertificate findValue="d4 79 bc 17 94 3a 3c 14 a1 a2 1f c7 ba b7 a7 3e 08 1b 0a 8d"
storeLocation="CurrentUser" storeName="My" x509FindType="FindByThumbprint" />
<authentication certificateValidationMode="None" revocationMode="NoCheck" />
</serviceCertificate>
<peer>
<peerAuthentication certificateValidationMode="None" />
<messageSenderAuthentication certificateValidationMode="None"
revocationMode="NoCheck" />
</peer>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
|
|
|
|