|
I want to create a table using java script, The user should enter the number of rows to be created in the txtTable when the user clicks, create table button, the it should create the table on the form(using java script)or any language.
oga m
|
|
|
|
|
Try with this Javascript
<br />
var theTable = gocument.getElementById('tableId');<br />
for( var x = 0; x < theTable.tHead.rows.length; x++ ) {<br />
var y = document.createElement('td');<br />
y.appendChild(document.createTextNode('Thead cell text'));<br />
theTable.tHead.rows[x].appendChild(y);<br />
}<br />
for( var z = 0; z < theTable.tBodies.length; z++ ) {<br />
for( var x = 0; x < theTable.tBodies[z].rows.length; x++ ) {<br />
var y = document.createElement('td');<br />
y.appendChild(document.createTextNode('Tbody cell text'));<br />
theTable.tBodies[z].rows[x].appendChild(y);<br />
}<br />
}<br />
for( var x = 0; x < theTable.tFoot.rows.length; x++ ) {<br />
var y = document.createElement('td');<br />
y.appendChild(document.createTextNode('Tfoot cell text'));<br />
theTable.tFoot.rows[x].appendChild(y);<br />
}<br />
Regards,
Satips.
|
|
|
|
|
<asp:CommandField ShowSelectButton="True" />
the above is my code for displaying the button Select
i would like to change it to an image button any ideas how to do that
|
|
|
|
|
add following properties into ur existing tag
<<asp:commandfield buttontype="Image" selectimageurl="~/images/Edit.gif" selecttext="Edit" showselectbutton="True"> >
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
|
Hi All,
I am using crystal report in ASP.NET 2.0 and I want to show a report which has many columns and it doesn't fit in one report,so I need to use sub report.Can anyone please tell me how do I start??Do I have to create 2 reports one is main and other sub???
Thanks in advance.....
|
|
|
|
|
Hi am using DetailsView and ObjectDataSource to insert records in database.
detailsview contains dropdown,texbox and Listbox controls.. I selected multiple items from Listbox and now if I click on Insert button multiple records has to be inserted in database. Is this possible...? can u send me the code how can I approach? pls see the following code..
while trying to put code for listbox it is inserting last record only...
// Code behind file
protected void DVDoctorActivity_ItemInserting(object sender, DetailsViewInsertEventArgs e)
{
if (Page.IsValid)
{
string strDoctor = ((DropDownList)((DetailsView)sender).FindControl("ddlInsDoctor")).SelectedValue;
e.Values["DoctorId"] = strDoctor;
e.Cancel = false;
}
foreach (ListItem listitem in ((ListBox)((DetailsView)sender).FindControl("lbProducts")).Items) // it is inserting only one record.. (last selected item)
{
if (listitem.Selected)
{
string strProductId = ((DropDownList)((DetailsView)sender).FindControl("ddlInsDoctor")).SelectedValue;
e.Values["ProductId"] = Convert.ToInt32(strDoctorId);
}
else e.Cancel = true;
}
// aspx file..
<asp:DetailsView ID="DetailsView1" runat="server" SkinID="DetailsView" DataKeyNames="DoctorActivityId"
DataSourceID="DoctorActivityDataSource" AutoGenerateRows="False" OnItemInserting="DVDoctorActivity_ItemInserting">
<Fields>
<asp:TemplateField>
<InsertItemTemplate>
<asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px">
<table>
<tr>
<td style="width: 113px; height: 21px;">
Doctor </td>
<td style="height: 21px">
<asp:DropDownList ID="ddlInsDoctor" runat="server" DataSourceID="DVDoctorMasterDataSource"
DataTextField="DoctorName" DataValueField="DoctorId">
</asp:DropDownList><asp:ObjectDataSource ID="DVDoctorMasterDataSource" runat="server"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetAllDoctors" TypeName="ActNexxt.ActNexxtDataSetTableAdapters.Doctor_MasterTableAdapter">
</asp:ObjectDataSource>
</td>
</tr>
<tr>
<td style="width: 113px">
</td>
<td>
<asp:TextBox ID="txtEdtEmpId" Visible="false" runat="server" Text='<%# Bind("EmployeeId") %>'></asp:TextBox> </td>
</tr>
<tr>
<td>
<asp:ListBox ID="lbProducts" runat="server"></asp:ListBox>
<asp:ObjectDataSource ID="CampaignDrugSource" runat="server"
InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetProductsByCampaignId"
TypeName="ActNexxt.ActNexxtDataSetTableAdapters.Campaign_DrugTableAdapter" >
>/td>
</tr>
</table>
</asp:Panel>
</InsertItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:Button ID="Button1" runat="server" CommandName="Update" Text="Update" SkinID="Button" />
<asp:Button ID="Button2" runat="server" CommandName="Cancel" Text="Cancel" SkinID="Button"
CausesValidation="false" />
</EditItemTemplate>
<InsertItemTemplate>
<asp:Button ID="Button1" runat="server" CommandName="Insert" Text="Insert" SkinID="Button" />
<asp:Button ID="Button2" runat="server" CommandName="Cancel" Text="Cancel" SkinID="Button"
CausesValidation="false" />
</InsertItemTemplate>
<ItemTemplate>
<asp:Button ID="Button1" runat="server" CommandName="New" Text="New" SkinID="Button" />
<asp:Button ID="Button2" runat="server" CommandName="Edit" Text="Edit" SkinID="Button" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Fields>
</asp:DetailsView>
thanks..
|
|
|
|
|
Hi friends,
Please give me some details reg. good book for asp.net for beginners.
Thanks in Advance.
Regards,
Prya
|
|
|
|
|
Wrox Publication books will good.
Regards,
Satips.
|
|
|
|
|
this is the situation.
i use form authentification as below
<authentication mode="Forms">
<forms name=".EHR_COOKIE" loginUrl="/EHR.WebUI/LoginForm.aspx" protection="All" timeout="180" path="/"/>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
so no one can get through my system without login through LoginForm.aspx.
let's say A person logged in through the LoginForm.aspx and then there is a menu on the top that will popup another browser so that A person can log in with different account.(we need this function because the client required) But as you know if A open a window from the logged in page, it will share sessions even though it looks like A has two different accounts with two diffent browses. The sessions will mix.
Does anybody know how can i separate the two accounts?
I know that it will be totally simple if A person log in and if he wants to log in with different account just click on iexplore icon and log in again. i mean this can be another solution if i can have two form authentification. <-- but i couldn't find the way.
anybody help..please...
-- modified at 21:43 Sunday 1st April, 2007
|
|
|
|
|
I use Css to apply to my lable control and it work well in design mode:
http://i2.photobucket.com/albums/y26/rockxuyenmandem/1-1.jpg
However when i view this page in browser Css doesn't apply changes:
http://i2.photobucket.com/albums/y26/rockxuyenmandem/2-3.jpg
Could someone give me the reason, thanks so much
|
|
|
|
|
Anyone have any suggestions on a software application to stress test an ASP.NET web application?
|
|
|
|
|
hello,
How can I create a new row in a grid view.
Thanks.
Dad
|
|
|
|
|
You cannot add new row directly to the GridView. But you can add new row indirectly.
Add a new Row in the DataSet which you assign to the GridView DataSource.
|
|
|
|
|
Hai,
when i am saving data through stored procedure the following error is coming i am not able to find where i have to change,
Description is below,
Thanks and Regards,
surendra
System.Data.SqlClient.SqlException: Unclosed quotation mark before the character string ','2','1')'. Line 1: Incorrect syntax near ','2','1')'. at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at NS.clinicalhistorygrid.NS_CLINICALHIST_MST_sp(String PARAMMYOPTION, DateTime PARAMCLINICHIST_DATE, String PARAMCLINICHIST_TIME, String PARAMSPECIALTY, Int32 PARAMCLINICHIST_ID, String PARAMPAT_REG_NO, String PARAMSTATUS, Int32 PARAMRELATION_PATIENT_ID, String PARAMGIVEN_BY, String PARAMCONSULTANT, String PARAMPRESENT_HISTORY, String PARAMTAKEN_BY, Int32 PARAMRETVAL) in C:\Inetpub\wwwroot\NS\clinicalhistory.aspx.vb:line 1681
surendra
|
|
|
|
|
This error means that you have ' somewhere in the middle of a column you are trying to save. Like if you are saving the person's name and their name is "o'neil" that would blow up. So you might need to check your strings for ' and either remove them or replace them with a " or something like that.
Hope that helps.
Ben
|
|
|
|
|
Hii,
i have one issue that i couldn't solve it, maybe anyone can help me:
i use disconnect datset to work with my data source.
i have 2 tables, one is visitors and another one is orders, the relation between these tables is an id field which is an increment field.
visitor can enter to the website, fill his details and order something.
first step i fill his details in a new row in the database.
now i want to fill a row of his order in orders table, there i have to set his id but i dont know the id because i have just update the visitors table and his id is automaticlly assigned, what can i do...
any help is HELP.
|
|
|
|
|
What Database do you use?
How do you insert the visitor record?
In SQL Server you can use scope_identity() function to return the last inserted identity.
|
|
|
|
|
If you use SQL Server, you can use @@IDENTITY to get the Last inserted identity value. To use this you have form the querys in a batch and then you have execute it.
Eg:
sQuery = "DECLARE @MyID AS INT"<br />
sQuery &= " INSERT INTO PrimaryTable (....) VALUES (....)"<br />
SQuery &=" SET @MyID=@@IDENTITY"<br />
SQuery &=" INSERT INTO SecondaryTable (...) VALUES (..@MyId...)"<br />
<br />
Com.CommandText = sQuery<br />
Com.ExecuteNonQuery
|
|
|
|
|
Hello,
How to handle events of Usercontrol(containing dropdownlist on .ascx page) on .aspx page.I am having a button on .aspx page.When I click on button ,i want to retrieve the value of selected dropdownlist item.I have used LoadControl() method to loasd the usercontrol on .aspx page.If possible try to explain me with example.
thanks,
aekta
|
|
|
|
|
In the usercontrol expose the selectedValue of the dropdownlist in a Public property on the UserControl. That way in the aspx page you can just do:
userControl.Publicproperty where userControl is the name of your UserControl variable and Publicproperty is what you named the SelectedValue of the Dropdown. The PublicProperty would probably be readonly with only a Get that points to dropdownlist.SelectedValue.
Hope that helps.
Ben
|
|
|
|
|
Hi there,
I'm writing a web application which extensively uses the Cache. Now I'd like to get an overview over all cached objects and their sizes in bytes. Does anyone know how to retrieve the size of an object in memory?
So far I've googled but didn't come up with something useful. Most answers were like 'you can't get the size...'. Btw, I'm using .net 1.1.
If it is not possible, is there a way to get the amount of memory the Cache is using altogether?
Any help is greatly appreceated.
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
Hi,
I am most likely doing something wrong that's really stupid and simple, but if anyone can help I will be very grateful.
I made a DataList with an SqlDataSource and FormView (with a label in) inside it. I used FindControl to get to the SqlDataSource and FormView to alter their properties, but when I do the same for the Label inside the FormView it just comes back with an error: "Object reference not set to an instance of an object."
The code I have is:
<pre>
Protected Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e As DataListItemEventArgs) Handles DataList1.ItemDataBound
If e.Item.ItemType = ListItemType.Item Or ListItemType.AlternatingItem Then
Dim FormView1 As FormView = CType(e.Item.FindControl("FormView1"), FormView)
FormView1.Visible = True
'This part works alrigh (I think)
'I must have made an error in the following code.
If FormView1.CurrentMode = FormViewMode.ReadOnly Then
Dim LabelRating As Label = CType(FormView1.Row.FindControl("lblRating"), Label)
Response.Write(LabelRating.Text.ToString)
End If
End If
End Sub
</pre>
I'm really sorry to be annoying, but I would really appreciate some help with this one.
Thank you!
Jack.
|
|
|
|
|
hi..
i am trying to add a drop down list value to the database.. the error comes is.. incorrect syntax near 'itemname'..
cmd2.CommandText = "Insert into Bill(BillNo,PatID,Test,TstCateg) Values('"+maxlbl.Text+"','" + patid.Text + "','" +DropDownList2.SelectedItem.Value+ "','"+DropDownList1.SelectedItem.Value+"' ";<br />
<br />
and just for the record.. it had worked previously.. in another app...
Kunal
|
|
|
|
|
check for datatype..
Thanks,
Sun Rays
|
|
|
|