|
hi
thanx for the help..
here i am a bit new to ASP.NET,and i am trying to develop a web page in ASP.NET using c#.since i am new to this field,can you help me about the session(i am new to the session) and database stuffs..
waiting for the reply
|
|
|
|
|
Hi,
assign the user name which logged in to session like this,
session["username"]=txt_username.Text
|
|
|
|
|
I would recommend you buy a book on ASP.NET and read it. If you're doing paid work, stop it, and you should be ashamed. If you're teaching yourself, you should slow down and work through a book rather than try to do something that you could only do very badly given your obvious lack of experience. You need to learn how to do it first, even if your code works, I expect it's far from production quality at this point.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi, In my project i used a gridview. I fill the details using Databind() method. And i want to format some detail using Html coding of the Grid view. They r working.
But during Runtime, the Datas are displayed twice both from html coding and Databind() method. How to avoid this?
I want to display only from Html coding? Is there is any code to fetch datas from Html?
|
|
|
|
|
Your best bet nearly always is using databinding. You can use runat="server" to interact with html elements, but I doubt that's what you want to do.
Perhaps if you posted your code we could point out what's wrong with it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
In C# i write this code for produce datas?
protected void lnkview_Click(object sender, EventArgs e)
{
view.Visible = true;
add.Visible = false;
try
{
con.Open();
com = new SqlCommand("select *from hotjob", con);
rd = com.ExecuteReader();
view1.DataSource = rd;
view1.DataBind();
con.Close();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
But i want some of the datas to appear in Link button. So i format it in the Html Coding.
<asp:gridview id="view1" runat="server" cellpadding="4" forecolor="#333333" gridlines="None" xmlns:asp="#unknown">
<footerstyle backcolor="#507CD1" font-bold="True" forecolor="White">
<rowstyle backcolor="#EFF3FB">
<editrowstyle backcolor="#2461BF">
<selectedrowstyle backcolor="#D1DDF1" font-bold="True" forecolor="#333333">
<pagerstyle backcolor="#2461BF" forecolor="White" horizontalalign="Center">
<headerstyle backcolor="#507CD1" font-bold="True" forecolor="White">
<alternatingrowstyle backcolor="White">
<columns> <asp:templatefield headertext="Job-ID" headerstyle-horizontalalign="Center">
<itemtemplate>
<asp:label id="lblId" runat="server" text="<%# Bind(" jid")="" %>"="">
<asp:templatefield headertext="Title" headerstyle-horizontalalign="Center">
<itemtemplate>
<asp:label id="lbltit" runat="server" text="<%# Bind(" title")="" %>"="">
<asp:templatefield headertext="Description" headerstyle-horizontalalign="Center">
<itemtemplate>
<asp:label id="lbldes" runat="server" text="<%# Bind(" description")="" %>"="">
<asp:templatefield headertext="Qualification" headerstyle-horizontalalign="Center">
<itemtemplate>
<asp:label id="lblqua" runat="server" text="<%# Bind(" qualification")="" %>"="">
<asp:templatefield headertext="Vacancies" headerstyle-horizontalalign="Center">
<itemtemplate>
<asp:label id="lblvac" runat="server" text="<%# Bind(" vac")="" %>"="">
<asp:templatefield headertext="Location" headerstyle-horizontalalign="Center">
<itemtemplate>
<asp:label id="lblloc" runat="server" text="<%# Bind(" location")="" %>"="">
<asp:templatefield headertext="Mail-ID" headerstyle-horizontalalign="Center">
<itemtemplate>
<asp:linkbutton id="lblmail" runat="server" text="<%# Bind(" mail")="" %>"="">
<asp:commandfield headertext="Delete" showdeletebutton="True" showheader="True">
This is the full code. It is working but datas display twice. I want to display only the Datas from Html.
|
|
|
|
|
Ah - add AutoGenerateColumns="false" to your grid view, by default it adds your templated columns AND generates one for each column in your data source.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi, thanks very much. Its working.
|
|
|
|
|
|
If this is a question then you're the stupidest person here, and that's some achievement. Turn off your PC, step away from it before you hurt yourself, and choose a new hobby/job.
Or, if you must persist, start by reading the forum guidelines, then move on to reading a book on ASP.NET, so you have some bloody idea of what is going on before you post such random drivel and expect us to solve it for you based entirely on magic ( you have an error, when does it happen, what does your code look like, what causes the error, you don't say, do you think we're psychic ? )
Sorry, I suffered fools more gladly when Microsoft gave me a reason to.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I'd love to know what that deleted message said. I need a laugh today
Regards
Julian Mummery
Please Visit my FREE Bug / Fault Logging Website at FaultLogger.com
|
|
|
|
|
Hi
Is there a way to get the item’s value that was just selected in a Checkboxlist?
I don’t what all the selected items.
Only the one that was just selected in my Checkboxlist before the postback
|
|
|
|
|
use
int i = convert.toint16(checkboxlist1.selectedvalue);
|
|
|
|
|
This only gives the first selected item in the Checkboxlist.
If two items are selected it will only look at the first item.
|
|
|
|
|
set multiple selection property true.
|
|
|
|
|
You can use javascript to keep track of last selected checkbox and put it in a hidden field.
On Postback, just get the value from that Hidden Field.
Hope this will help.
|
|
|
|
|
hi all
i have created a datatable with some columns.
then i added a report file and set the fields using datatable.
then i have taken a reportviewcontrol in my .aspx page
now i bind my report in runtime
everything is going fine but when the report is generated the value data drop field of report is one (but i datatable the value is more than one).
for coding please check the article :
http://www.aspfree.com/c/a/ASP.NET/Binding-Data-to-the-ReportViewer-Control-Dynamically-in-ASPNET-20
Er. Jagwinder Singh
|
|
|
|
|
Try this video about ReportViewer
http://download.microsoft.com/download/4/1/9/4191d186-e2a1-4b45-b4dd-b6364a4d5ced/14ReportViewer.zip
|
|
|
|
|
is it possible to display the checkboxes on the right side of a gridview when we use template field..
scarface
|
|
|
|
|
Yes, you can just go in gridview property and change order of columns.
|
|
|
|
|
i did check the properties of gridview but where is the ordering of the columns..
scarface
|
|
|
|
|
Go to .aspx page.In the gridview inside columns the column names alongwith it's properties are there.You just move that checkbox row to the last order.
|
|
|
|
|
well i did try dragging the checkbox column but thats not working..and i checked in the properties but there is no option for that..
scarface
|
|
|
|
|
what man u have to just move the checkbox column to the last order in aspx code.
say:<column 1:asd="" xmlns:1="#unknown"><column 2:sd="" xmlns:2="#unknown"><column 3:checkbox="" xmlns:3="#unknown">Like that order only u have to keep.
|
|
|
|
|
hey that message wasnt getting displayed..i tried in code..but there is no property as ordering of columns..am not getting as to where are you referring to change..
hey thanks for your help..
scarface
|
|
|
|