|
You can do it this way rather then using remove
yourString.SubString(yourString.indexOf("=") + 1);
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Dim sStr = "Room ID = jghdu"
Dim sArray as string()
sArray = sStr.Split("="c)
sArray(1) will have your string after "="
|
|
|
|
|
Hi,
I have a button in my web control which is being clicked to save the record in the database and form is closed by a javascript generated which runs which is registered.
When this button is clicked , the sequence of events happening are
1. page_load occurs
2. custom control page_load occurs
In my step 1 page_load there is lot of code which is not necessary if this button is clicked, but for now it runs anyhow and it takes a lot of time to close the window.
How can I find that this button is clicked in the page_load and set any value which is checked in the page_load and the exit happens early in pge_load allowing the page to close early on.
any tip will help.
regards
sambhe
|
|
|
|
|
1. If you don't want the code in page_load to run when button is clicked then put that code in the following block
if(!isPostBack)
{
}
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
thanks Ahsan,
but I can not put all the code in (!isPostBack) block , I have some other buttons in the custom control which will need code out of this block and some code has to be excuted at the very first page_load only. My form is very large one. i have some controls disabled at the form submit but I want to read those values so in form submit javascript I enable these controls just to read their values and disable them again. this all takes very long time, but for this particular button , i do not need such functionality it just do something and close the form immediately though the registered javascript (window.close()) but everytime whole of this code gets executed and take long time. Si I want to capture the click event of this button before all of this happens and in page load i dont allow anything to get executed and exits page_load early on . But no idea how I should capture this and save it in something and check that condition in page_load.
regards
Vijay
|
|
|
|
|
When you use a server control like button. It will be postedBack. You can not avoid this. So i guess you should have a work around of your problem.
Try using Ajax
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
what is master pages in asp.net?
|
|
|
|
|
Master pages serve the purpose to keep the central design in one file. So that when you change the design you don't have to change on all pages. It is same as what templates do in dreamweaver.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
The questions you are aksing are fairly and basic and you would find more answers searching the Internet. There are plently of beginner articles out there for yourself to help you get started. When you have a problem with some code feel free to post back.
|
|
|
|
|
|
master pages are mainly used for set header and footer pages
|
|
|
|
|
what is page tag and register tag in asp.net? also difference between both?
|
|
|
|
|
Page tag is the mandatory tag for an aspx page. It is used for setting some attributes like codefile etc. A page will not render without it.
Register tag is used for registering user controls. Whatever user control you will be using on the page you have to register it using register tag.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Hello,
I'm pondering the use of threading in my asp.net application, and would sure like some input from you guys.
Upon a succesful login, details about this login must be written to a database. In itself an operation which has no influence on the application per se. So as to not slow the app down, I'm considering sending this to a thread of its own, as I anticipate a hefty run on the application throughout the two weeks it will be up. Would this make sense to ship off to a seperate thread - or would there be too many complications (such as a maxed out threadpool) deriving from this?
I'm not big on threads in asp.net, but hopefully some of you are, and have a piece of advice for me.
Thanks in advance,
Morten
|
|
|
|
|
I would like to know why do you want to save the details of login. If it is for reporting purpose ( who has logged in since date so so) then i would like to say that rather then making another query to the database for saving the details and making a thread, you should do the following.
Query the database for username and password (through a stored procedure) if they are valid (successful login) insert these details in the table you want to save (in the same procedure0 and then return to redirect the user to the successfull login page.
Hope it solves your problem.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Hello Ahsan,
it is indeed for purposes of reporting. I think you indicated the better way to go; thanks for your input.
Morten
|
|
|
|
|
I have a web app that has a number of class library projects (which have the business logic). Currently, these class libraries each have a Settings.settings file to contain application settings (like feedback messages and format strings). During runtime i want to be able to go onto the server and change the value of one of the settings.
Essentially I want what is currently available for the web project - it has a Web.config file which has all the application settings. I am able to change these settings during runtime.
|
|
|
|
|
Use the app settings in your web config instead, and use HttpContext.Current ( from memory ) to read those values.
Nope, completely wrong.
WebConfigurationManager.AppSettings("ConnectionString") for example reads
<appSettings>
<add key="connectionString" value="Data Source=xxx;User ID=sa;Password=yyyyy;Initial Catalog=zzzz"/>
</appSettings>
from a dll in my project.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hi,
Thanks for your reply.
Do you mean the Web.config file in the website?
That is what i will resort to if I can't get my way, but I was hoping to still be able to use Settings.settings or something similar in the Class Library (not something in the website).
|
|
|
|
|
Hi All,
When im trying to add a .DAT or .mp3 files using a HTMl file upload control, the page is showing or redirecting to the page with information "Page Can not be found" .please help me out to solve it.I dont knw what exactly the problem.When im uploading .txt or .doc or image files its working properly.I want a file upload control which can upload all type of files(.jpg,.txt,.doc,.mp3,.dat,.wmv and all )
Thanks in ADvance
|
|
|
|
|
There is only one file upload control. EVER. You realise that, right ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Don't use words like urgent in your post or subject line. That's just flat out rude.
"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
|
|
|
|
|
I especially love when it's not so urgent for them to bother replying to people who try to help.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Yeah, I figure those types are ones who put out their inquiry and hope for an instant answer. After all, isn't the Internet supposed to be instant information at one's fingertips
"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
|
|
|
|
|
I'm just curious what it is they do, if they don't repost, for them to be gone and not willing to respond ? I think it's more the case that I tend to ask questions they can't answer so they sit tight for code they can copy and paste.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|