|
Please run your page in debug mode, and set a breakpoint at the rp1_ItemCommand method. Then you can see what is causing this problem.
"My personality is not represented by my hometown."
|
|
|
|
|
Properties of btn: OnClientClick "" string
PostBackUrl "" string
UseSubmitBehavior true bool
Why OnClientClick "" string
|
|
|
|
|
Please read some documentation on ASP.Net first; Really try to take your time. Learning to program requires a lot patience and time. Then if you have questions, try to not post a question in 15 seconds, but really think how others will read it. So, give an explanation that is logical and describes the problem.
Once I have more details on your issue I will be glad to help.
Good luck!
"My personality is not represented by my hometown."
|
|
|
|
|
Thank
|
|
|
|
|
since you are dynamically adding control so the controls are not saved.
try adding the controls when the page post back aging and it should work then
|
|
|
|
|
hi, I have the follwoing form:
this is T_Current_Cost table
====================================================================================
No item Cost
====================================================================================
1 books 500
2 papers 250
3 software // this item from T_Software table
====================================================
SWID Software Version OS Cost
1 Photoshop 12 WinXP 400 (Total: 1000 )
2 MS Office 2010 Win7 600
4 Printing 350
5 Devices // this item from T_Devices table
====================================================
DevID Device Cost (not excedding $50 for each)
1 X 45
2 Y 20 (Total:115)
3 Z 50
6 Others...
the task is insert the cost, software, version, OS ,Device ?? can any one help me plz
|
|
|
|
|
hameedsabacode wrote: the task is insert the cost, software, version, OS ,Device ?? can any one help me plz
Where do u want to insert these details?
is it in the database? (so u need Sql Query to insert into a table?)
is it C# code that u need to insert data into your table?
What do u want exactly?
Any examples of what u have done so far on this task?
|
|
|
|
|
thank you for you concern...
I want to insert these values into the named tables (I mentioned in my question)in my database by ASp.net form
I use C#
the problem is in the item number 3(software)shall I use a gridview or what ?
the page is about a reseacher wants to insert the requirements of his research
|
|
|
|
|
Hi,
I am trying to build up my knowledge regarding ASP.Net and new things which I read from books. Frankly, its few days I got this error. after running my code I see this error
No matching bindings are available, and the type is not self-bindable. Activation path: 2) Injection of dependency CommunityUserRepository into parameter _rep of constructor of type AccountController 1) Request for AccountController
it is the source code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Ninject.Core;
using SportsStore;
using SportsStore.WebUI.Controllers;
using System.Web.Routing;
using Ninject.Modules;
using Ninject.Core.Modules;
using SportsStore.Domain.Abstract;
using System.Configuration;
using SportsStore.Domain.Concrete;
namespace SportsStore.WebUI.Infrastructure
{
public class NinjectControllerFactory : DefaultControllerFactory
{
private IKernel Kernel = new StandardKernel(new SportsStoreServices());
protected override IController GetControllerInstance(RequestContext context,Type controllerType)
{
return controllerType == null ? null
: (IController)Kernel.Get(controllerType);
}
private class SportsStoreServices : StandardModule
{
public override void Load()
{
Bind<IProductRepository>().To<SqlProductRepository>().WithConstructorArgument
("connectionString", ConfigurationManager.ConnectionStrings["AppDb"].ConnectionString);
}
}
}
}
error occure in this line
protected override IController GetControllerInstance(RequestContext context,Type controllerType)<br />
{<br />
<br />
return controllerType == null ? null<br />
: (IController)Kernel.Get(controllerType);
Could you please help me?
|
|
|
|
|
Hello,
I am trying to store the image to the database and display the image from the database to the dataset. Well I saved image in binary format to store. And when i try to pull that image from the database, it didn't work.
table is:
CREATE TABLE [dbo].[tblFiles](
[id] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](50) NULL,
[ContentType] [varchar](50) NULL,
[Data] [varbinary](max) NULL,
CONSTRAINT [PK_tblFiles] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
stored procedure viewtblFiles is:
CREATE PROCEDURE [dbo].[viewtblFiles]
@ID int
AS
BEGIN TRANSACTION
select Name, ContentType, Data from tblFiles where id=@id
COMMIT TRANSACTION
My code for that is:
SqlConnection cnx1 = new SqlConnection(connection.strCnx);
SqlCommand cmd1 = new SqlCommand("viewtblFiles",cnx1);
SqlDataAdapter sda = new SqlDataAdapter();
cmd1.CommandType = CommandType.StoredProcedure;
cmd1.Parameters.Add("@id", SqlDbType.Int).Value = 4;
DataSet dt = new DataSet();
try
{
cnx.Open();
sda.SelectCommand = cmd1;
sda.Fill(dt,"tblFiles");
GridView1.DataSource = dt;
GridView1.DataBind();
}
catch (Exception ex)
{
string s = ex.ToString();
}
finally
{
cnx.Close();
sda.Dispose();
cnx.Dispose();
}
when the programs runs, it didn't give any error but the dataset doesn't include the image file.. is there any idea to get the image in my dataset along with other fields ??
suchita
|
|
|
|
|
|
Hi,
I have four gridview in my asp.net page. I want to call databind method asynchronouly. I don't want to call it sequentially as it consumes lot of time.
What is the best way to do this? What are the potential issues of trying to do databaind operation in differnt thread for the same browser.
Thanks in advance.
Afsal
|
|
|
|
|
It will consume more time to populate if you do it asynchronously.
The best way I have found to present the user with a loaded page and then load data after the page is rendered is with AJAX calls. The other method is to use an aysnc page but that is no fun.
|
|
|
|
|
Thanks for the reply.
Well, I need to resolve this somehow. The issue I am facing now is four database calls altogether takes around 1 minute to retrieve the data. So I thought of making it into four different threads and binding it seperately.
Are you sure it will not give me advantage?
If I am loading everything at one shot, i am getting a "script taking longer time. Are you want to abort" like java script error message.
Also, can you please explain your solution in a bit detail? May be by giving some links!
|
|
|
|
|
Multithreading may not be a solution here. The queries you are running dont seem very efficient. If these queries are taking one minute to run, than you might have to rethink what you are attempting.
Here are a few suggestions:
1) Make sure your tables/views are indexed. If they are make sure your indexes are not fragmented. That will cause your queries to take longer than they should.
2) If you are using SELECT * and dont need all those columns, updatethe query to selec the columns you actually need.
3) Use stored procedures instead of inline queries. Stored procedures have an advantage because their statistics/execution plans are stored for future executions. This may increase the time it takes to run your query.
4) Make sure you dont have crazy joins. These are usually a major problem with complex, slow running queries.
5) If you are returing many many many rows, you may want to consider server side paging.
Hope this helps.
|
|
|
|
|
Hi guys,
i am creating a table on runtime, i would like to add a few attributs to this table.
I have so far managed to add:
tr.Attributes.Add("onmouseover", "this.style.backgroundImage='url(images/pagebg.jpg)';this.style.cursor='pointer';");
tr.Attributes.Add("onmouseout", "this.style.backgroundImage='url(images/tagcontent.gif)';this.style.cursor='pointer';");
..but i would also like to add an 'onclick' so that when a user clicks on a row then a radio
button in that table on that row...does anyone know how i can do that?
please help me...
Regards,
Morgs
|
|
|
|
|
Have you tried adding onclick attribute just as you added other attributes? whats the problem you are facing?
|
|
|
|
|
Hi Arun...thanks for your reply,
i don't know how to add an onclick so that a radio button gets checked..
here is the missing part:
tr.Attributes.Add(key, value);
tr.Attributes.Add("onclick", "?");
Please help me..
|
|
|
|
|
MorgSim wrote: tr.Attributes.Add("onclick", "?");
Call javascript function,
tr.Attributes.Add("onclick", "SelectRadioButton('"+ radiobutton.ClientID +"');");
and from that javascriptmethod select the radio button,
function SelectRadioButton(rbtnId)
{
document.getElementById(rbtnId).checked = !document.getElementById(rbtnId).checked;
}
Code is not tested, but I hope this will work.
|
|
|
|
|
Yeahh thanks Alot Arun...worked just fine..
|
|
|
|
|
try like this.
protected void Button1_Click(object sender, EventArgs e)
{
HtmlTable table = new HtmlTable();
HtmlTableRow tr;
HtmlTableCell td;
for(int i=0;i<10;i++)
{
tr = new HtmlTableRow();
tr.ID = "tr" + i.ToString();
string cbxID = string.Empty;
for (int cols = 0; cols < 2; cols++)
{
td = new HtmlTableCell();
if (cols == 0)
{
HtmlInputRadioButton radio = new HtmlInputRadioButton();
cbxID = "rdb" + i.ToString();
radio.ID = cbxID;
radio.Name = i.ToString();
radio.Value = "RadioButton" + i.ToString();
td.Controls.Add(radio);
tr.Controls.Add(td);
}
else
{
td.InnerText = "Row Number" + i.ToString();
td.Attributes.Add("onclick", string.Format("checkRadio('{0}');", cbxID));
td.Style.Add(HtmlTextWriterStyle.Cursor, "pointer");
tr.Controls.Add(td);
}
}
table.Controls.Add(tr);
}
Panel1.Controls.Add(table);
}
<div>
<asp:Button ID="Button1" runat="server" Text="create Table"
onclick="Button1_Click" />
<asp:Panel ID="Panel1" runat="server">
</asp:Panel>
<script language="javascript">
function checkRadio(cbx)
{
document.getElementById(cbx).checked = true;
}
</script>
</div>
[edit] add comments[/edit]
modified on Monday, August 16, 2010 6:46 AM
|
|
|
|
|
Yeah thanks alot man...it worked just fine..
THANKYOU
|
|
|
|
|
hi guys
one page of my site didn't load its element and show me nothing
where the heal are my elements?
i got html source in IE and saw a specific block of java code repeated 5 times
why?
modified on Monday, August 16, 2010 2:40 AM
|
|
|
|
|
Try debugging you may get something..
Also you have not provided enough information. Explain it bit more.
|
|
|
|
|
Hi All ,
I have one application which is listening other application . that code i had written in application_start for that i need to open my page atleast once but i have requirement that as soon as IIS start it should start lisnting no matter page opens onot can u guys give me idea.
thanks,
Amit
|
|
|
|