|
|
Thanks for the reply.
Actually we get the selected Index in DataGrid at e.item.itemIndex,then how will I get the same in GridView???
ItemDataCommand in DataGrid we can delete any of the row and also put the javascript code on it.
So how do I do the same in GridView??
And same for ItemDataBound??
Thanks and Regards.
|
|
|
|
|
e.Item.ItemIndex = e.Row.RowIndex
Rest of all the things are similiar only...
|
|
|
|
|
But I dont get e.Row.RowIndex on RowCommand....
|
|
|
|
|
On RowCommand, use GridViewName.SelectedIndex
|
|
|
|
|
Guys, I am working on a rather large web app (ASP.Net 1.1). I went ahead and added a new page in the app, which could be accessed from the home page of the site. So I put an anchor tag on the Home pages aspx page, and the href (the page’s url). It works fine and redirects me to the new page I added from the Home page. But now at the new page when I select background color and size and then hit the submit button, at that point it is taking me back to the main page. I have no idea why???? Once I’m back at this main page, I click the link again to go to my new page with new functionality and the properties are applied (that background color and text changed as specified). But I want to stop this redirect to the main page. Here is what I did that I was thinking will solve this issue.
I added an onClick attribute in the declaration of the anchor tag onClick = “Redirect” where Redirect is a function I wrote which performs Response.Redirect("Main/myPage.aspx"); Apparently this didn’t fix it.
I think its because even on my new page…the properties (background color, font and stuff) only takes effect when I click the submit button twice. The first time nothing happens??? Can anyone please help. Following is the code I’m using in the button’s click event handler.
<br />
HttpCookie cookie = new HttpCookie("preferences1");<br />
cookie.Values.Add("ForeColor",ForeColor.SelectedItem.Value);<br />
cookie.Values.Add("BackColor",BackColor.SelectedItem.Value);<br />
cookie.Values.Add("LinkColor",LinkColor.SelectedItem.Value);<br />
cookie.Values.Add("FontSize",FontSize.SelectedItem.Value);<br />
cookie.Values.Add("FontName",FontName.SelectedItem.Value);<br />
<br />
Response.AppendCookie(cookie);<br />
<br />
if ( ViewState["Referer"] != null )<br />
{<br />
Response.Redirect(ViewState["Referer"].ToString());<br />
}<br />
<br />
Thanks
Tina
|
|
|
|
|
I am not getting your problem properly. Can you explain it properly?
I need to know what the exact thing is not working at your side and what do you want to happen.
Thanks and regards,
Chetan Ranpariya.
|
|
|
|
|
Hi,
I feel Like there is some redirection page that is configured at the level of web.config that is redirecting you to the home page.
for the 2nd case:
you need to reload the page after the sumbit is hitted and also while reloading you need to read from cookies which i think you are not doing. it is automatically happened when you are clicking twice the button once it will submit and the next it is posted back.
|
|
|
|
|
Hi nagendra, thanks for your response. I appreciate it. Well when it started redirecting me to the Home page, first thing I did was to check the web.config file. The only redirect they have in there is for custom error pages when mode = remote and ofcource the redirect from login.aspx since we are using forms based authentication. But I really think that this might have anything to do with this issue of double click? I see what you are saying above, so when I’m simply adding the values from drop down lists into the cookies collection, I’m not reading them in …and so they are not getting applied. But I guess I’m confused that if that’s the case then it shouldn’t be applied at all regardless of how many times I click the button? Could you please show me how to fix that ( or a way to read them in so they will apply as soon as the button is first clicked). NOTE: I just notice when I first run the page (ctrl+F5). And the very first property I select from the list is applied properly but then the rest needs clicking twice. So it sounds like the initial GET request is working but when you submit (that is post back) that’s when its not working. The sample I used to build this is on gotdotnet site (http://samples.gotdotnet.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/apps/cookies1/cookies1.src&file=CS\Customize.aspx&font=3).
I would really appreciate all your help.
TINA
|
|
|
|
|
Hi there, I figured out the redirection problem. I was actually redirecting it myself (by mistake ofcourse). Here is what I was doing:
<br />
if ( ViewState["Referer"] != null )<br />
{<br />
Response.Redirect(ViewState["Referer"].ToString());<br />
}
Since the main page is the one that was making the initial request, in the view state I was caching the url for that page and in the button_click I was doing a response.redirect.
Anyways that is solved now… but it still requires clicking the button twice for the properties to take effect. And like you said in the previous post, its not happening because I’m not reading from the cookies again. I’d really appreciate any help.
Thanks
TINA
|
|
|
|
|
I'm creating my first vs.net 2005 web site project and I've noticed there are some differences between compiling in vs 2003 and vs 2005. In particular, the lack of a "Release" option in the "Solutions Configurations" drop down box.
So instead, I selected "Build --> Publish Web Site". I then select a new "Target Location" in the Publish Website dialog box and then build my project. Finally, I copy and paste all newly compiled files from this new directory to my server.
It works fine however there are a few things I find annoying and I'm curious if they can be changed:
1) After compiling, I receive about a dozen project DLL files. Why is this and can I reduce this to only 1 like it used to be with vs.net 2003?
2) When refencing 3rd party DLL files, I notice they don't appear in the "Bin" directory. Are these DLL's included in the dozen project files or do I need to manually drag and drop these DLL's into the servers' "Bin" directory?
Thanks.
-Goalie35
|
|
|
|
|
Hi Everyone:
I have progressed to the point where I need to retrieve data from the Web.config file in my ASP.NET project. In order to do this efficiently I need to write a function that returns the required data by reading certain parts of the web.config file in the project solution.
My problem is I don't know how to do this in ASP.NET. Can anyone give me step by step instructions on how to accomplish this?
Thanks in advance,
Quecumber256
|
|
|
|
|
|
That is my main problem. I spend more time trying to find out how to use the tools than I do using them.
Ever since Microsoft has stopped supplying the Programmer's References to their development platforms figuring out how to do something takes more time researching it, than using it.
It is like going back to class. Everything changes so drastically you have to relearn the system from scratch.
When I first started with computers, when you wrote a program the compiler took the program and broke it down into machine language. This way a compiled program could run on any operating system.
Quecumber256
|
|
|
|
|
Quecumber256 wrote: Ever since Microsoft has stopped supplying the Programmer's References to their development platforms figuring out how to do something takes more time researching it, than using it.
Oh heavens!! How can Microsoft expect programmers to actually think for themselves?
Quecumber256 wrote: This way a compiled program could run on any operating system.
Really!? Wow I must have been missing something, I could never get my IBM 360 app to run on the TRS80, or the Win 3.11 app on the MacIntosh.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: Oh heavens!! How can Microsoft expect programmers to actually think for themselves?
I don't know about you, but when I'm writing an application. I'm thinking about the task the application is suppose to perform. Not spend half a day looking up how the controls, and so forth are designed to be used. That information is usually placed in a Programmer's Reference so the programmer can grab the book, look up what he needs, modify it to his application and proceed to the next part in his application.
Mark Nischalke wrote: Really!? Wow I must have been missing something, I could never get my IBM 360 app to run on the TRS80, or the Win 3.11 app on the MacIntosh.
A TRS80 ran an old 5502(?) processor and used an "Interpreter" not a compiler. At the time you are referring; MacIntosh used a different processor than most PC manufacturers who where using Intel processors. Windows was designed for 80186, 80286 and so on processors. Different processors use different assembly language sets. Now days most PC's are based on some form of 80?86 processors.
I don't want to start an argument. I like to work efficiently and having to spend so much time trying to find out how to use something annoys me to no end.
Have a wonderful day,
Quecumber256
|
|
|
|
|
|
Mark Nischalke wrote: Completely missed the joke. I'd explain it to you but I have to go fix someone's code who couldn't be bothered with reading the documentation.
If you know where said documentation is: Please point me in the proper direction.
FYI - I'm quite a bit behind the curve. VB 6 had a Controls and language reference built inside its help. I could refer to this documentation when I needed specific help when it came to aquiring understanding on how certain properties, methods or events where used for each control along with documentation on the language itself.
If you can help with the issue contained in the first paragraph, I thank you. As to the purpose of this inquiry: I asked another developer about how to create functions in VS 2005 for a Web application and he showed me in about 5 minutes.
Quecumber256
|
|
|
|
|
Quecumber256 wrote: VB 6
Well that explains a lot, now I understand your problem
F1 help is integrated into VS, but your probably never took the time to read about how to use it.
Quecumber256 wrote: asked another developer about how to create functions in VS 2005 for a Web application and he showed me in about 5 minutes.
Probably because he took the time to read the documentation. However, your initial inquiry was about retrieving data from the web.config file despite the title mentioning public functions.
Quecumber256 wrote: If you know where said documentation is: Please point me in the proper direction.
Now what is it you would like to know so I can point you to the proper documentation? Not that you will take the time to read it.
only two letters away from being an asset
|
|
|
|
|
Hey.
I am using ASP.NET to develop a website, so far it has been fine - postback calls btnSubmit_ServerClick.
However I now wish to have some drop down lists (for dates) where the amount of days available changes according to the month selected. But when this posts the page back how do i make sure btnSubmit_ServerClick is not called aswell as drpMonth_OnChange.
I have a nasty feeling i am being an idiot but have become confused.
Thanks for reading this.
Cheers
Dan
|
|
|
|
|
Does the drop down automatically post back, or do you have to click the button in order to postback when the drop down changes?
If you have to click the button then you are naturally going to get the button click event being handled.
|
|
|
|
|
hmmm i think something may be going wrong, I have checked my event handlers and the wireup code, also I have fixed ASP.NET a few times (due to events not being fired when they should) but the dropdownlist doesn't appear to autopostback.
Edit* Hadn't set autopostback - thought I had sorry to waste your time, thanks very much any way thought *
Cheers
Dan
-- modified at 4:24 Wednesday 3rd January, 2007
|
|
|
|
|
Hi.
Can anyone give me a sample code, that dynamically add an item in site map.
Best wishes
|
|
|
|
|
please
show me the way to do:
when user1 open url - they see some text, "total: 1" for example
when next user2 open same url - they see "total: 2" AND for user1 screen automaticaly refreshing and appear text "total: 2" too.
sorry for english thanks for any help!
ICQ: 132048383, e-mail: ezbar@yandex.ru
|
|
|
|
|
Depending on the type of application, you may not want to refresh a users page when another person opens that application. Just imagine if someone is entering data, and is about finished, when your application refreshes their page, losing all their info.
|
|
|
|