|
Thanks, It works fine
Regards,
Jay
|
|
|
|
|
Move the Insert statement after the DataBinding like below
ddlDept.DataSource=deptDS.Tables[0];
ddlDept.DataTextField="DeptName";
ddlDept.DataValueField="DeptCode";
ddlDept.DataBind();
ddlDept.Items.Insert(0,"--Select--");
|
|
|
|
|
Thanks, It works fine.
Regards,
Jay
|
|
|
|
|
|
Only thing is that you need to keep that line down...
something like this:
ddlDept.DataSource=deptDS.Tables[0];<br />
ddlDept.DataTextField="DeptName";<br />
ddlDept.DataValueField="DeptCode";<br />
ddlDept.DataBind(); <br />
ddlDept.Items.Insert(0,"--Select--");
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi,
Thanks Apurva. How are you? Meet you after long time.
Apurva Kaushal wrote: ddlDept.Items.Insert(0,"--Select--");
Actually this code works fine. But incase of this 'ddlDept' has the AutoPostBack property to TRUE and one more DDL is bind to Items based on the SelectedValue of the 'ddlDept', then
ddlDept.SelectedValue
gives me the error? How to overcome this with your code.
Regards,
Jay
|
|
|
|
|
Jay_se wrote: Thanks Apurva. How are you? Meet you after long time.
Always welcome...
Ya I was away for some time from CP.
Jay_se wrote: gives me the error? How to overcome this with your code.
What error?
BTW you can access the value of the selected item like this:
ddlDept.SelectedItem.Value.ToString();
Best Regards,
Apurva Kaushal
|
|
|
|
|
Ohh boy so many replies.. actually i haven't seen them and directly posted the reply....
Anyway its is really nice that there are so many active members there in this forum...
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi all,
Can I get any .net developpped library with proper UI, which gives the same functionality as DSO Framer control thats to display and edit office doc, xls etc files. Because the DSO Framer control uses unmanaged code which gives problem in web applications when hosted in clients local machine. So I need any .net developped tool to get these functioanlities done. I tried with aspose, but to change the document again we need to change the code, or we have to fight with sumo to make it independent of document format. So please
help me in this. You can email me at : aleem_abdul@akebonosoft.com. My requirement is to display the word or excel files in a browser, allowing user to edit it there only. He can email it from that page itself only only. Remember this page should contain a tool bar which contains appopriate buttons for those functionalities. The problem when I use aspose is, it doesnt have UI so occupies total page and if I want to change the format of the file(document), I need to change the code. And the problem with DSO Framer control is(it has nice UI but) it has to be installed on the client machine because it contains unmanaged code. By observing all these things please advise me.
Thank you.
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
how can we do paging in datalist in asp.net 1.1
|
|
|
|
|
You need to use custom paging. you can have a look at this.[^]
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi viney
There are many ways to do this. one of good is replied by "Apurva Kaushal". There is another way with help of database. (sql server 2000) make a procedure and you will have to make some parameters which can count the total no. of records. in datalist/repeater. and also you have to define the parameter which can help you divide the records(for how many records you want to display). i will send you code ASAP.
Thanks and regards:
Rohit K
rohit
|
|
|
|
|
Hi all,
I am new to ASP.NET 2005.I have used DataGrid control of ASP.NET 2003 version.I want to know what r the events like we have itemDataBound and itemDataCommand in 2003 what are the similiar events for GridView???
Thanks in advance.
|
|
|
|
|
|
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
|
|
|
|