|
I wouldn't be suprised if there is no solution using a textbox. This almost sounds like it would be better as a grid control. You can perform much finer access control in a grid.
Good luck.
|
|
|
|
|
I'll make the assumption that any line which can be edited cannot be broken into multiple lines...
Use JavaScript to listen for any change/key press/etc events. Also, use JavaScript to store the original text in an array (it will also store if a line is read only). Any time the text changes, check to ensure that any read only lines did not change. If they did, modify those lines so they are back to their original.
When the textbox is submitted back to the server, have your C# or VB.Net code do the same check as the JavaScript (in case the JavaScript was bypassed).
As somebody else mentioned, it would be much easier to use another control, such as a grid view (or repeater), to split each line into its own control. That will allow you, for example, to more clearly indicate which lines are editable and which are read only (e.g., by graying out the read only lines).
|
|
|
|
|
I would say better would be using one from tone of JS libs, and RegExp on server but it's just my opinion.
Also if customer would allow this with his browsers HTML5 masked textbox would be good solution to.
No more Mister Nice Guy... >: |
|
|
|
|
|
maybe you can create a new webcontrol,the textbox is not fit for your situation!
|
|
|
|
|
|
Hi guys
I need help.
I would to know how to fill listbox with dropdown list data please
Thx
|
|
|
|
|
please clear you scenario still i m giving you an answer .
Solution 1.
you can fill the listbox from dropdown data by using Dictionary or list .
1.first get your data in a dictionary.
2.then fill your list box using this data.
Soultion 2.
ListBox1.Items.Add(DropDownList1.SelectedValue);
|
|
|
|
|
Thx you for you help.
MoreOver I would like know how I can use the Dictionary, my question is how the post the article which I select in my dropdownlist, then how i make to record it by getting back Id
|
|
|
|
|
|
thx guy but i would like to keep the iD for my listbox and keep in one table who have two FKs
Thx
|
|
|
|
|
Hello everyone,
i have a gridview that call a rowupdating command in a ascx file.
i added dropdownlist with postback but i'm getting a null values.
i tried it in aspx file and its working.
what could be the problem?
Thanks in advance,
jyn
|
|
|
|
|
make sure your .ascx file page load contains
if (!IsPostBack)
{}
and you are binding within it .
|
|
|
|
|
Hi!
Does anybody know when specifically this error happens?
-------------------------------------------------------------------------
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 10/5/2012 3:35:46 PM
Event time (UTC): 10/5/2012 5:35:46 AM
Event ID: 185e3ac798ae4f7f96e5fb515ea57c07
Event sequence: 166
Event occurrence: 79
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/32/ROOT-1-129938852424390639
Trust level: Full
Application Virtual Path: /
Application Path: D:\INDIGO8SYNC\PublishedWebsites\Nookie_Subscribe\
Machine name: AUSTRALIA1
Process information:
Process ID: 6856
Process name: w3wp.exe
Account name: IIS APPPOOL\nookiecomau
Exception information:
Exception type: HttpUnhandledException
Exception message: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Request information:
Request URL: http://www.nookie.com.au/default.aspx
Request path: /default.aspx
User host address: 110.143.108.249
User:
Is authenticated: False
Authentication Type:
Thread account name: AUSTRALIA1\Administrator
Thread information:
Thread ID: 12
Thread account name: AUSTRALIA1\Administrator
Is impersonating: True
Stack trace: at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.default_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Custom event details:
-------------------------------------------------------------------------
Thanks!
<rattlesnake><3:16>
|
|
|
|
|
rattlesnake316 wrote: Does anybody know when specifically this error happens?
Whehe, pointing out a generic exception, without access to code?
Seems you're missing an exception-handler: "at System.Web.UI.Page.HandleError(Exception e)". What happens in that method?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Have you tried to set a break point and step through the code?
In order to help you with this, we would need to see the code that is generating the error and what you were attempting to do when you received it.
|
|
|
|
|
Hi
I have downloaded SharpWebMail from sourceforge, but I am unable to integrate in my existing Asp.Net Project which is made in asp.net 3.5
Please suggest me to integrate this code in my project.
thanks
|
|
|
|
|
Guys;
I have run a code that connect to an excel file on a web service and it worked.
now I run the same code on a windows service running on the same host but it gave me the exception of:
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
Help people,so poeple can help you.
|
|
|
|
|
|
Item #4 of the above link states that it is not intended for "Quote: ... a program called from server-side web application such as ASP.NET ...
So what is the preferred method to access data stored in Excel for an ASP.NET application ?
I understand that you don't want to build an OLTP system usign Excel as a datastore ... but I have a situation where there is a spreadsheet which is updated by one department and I was thinking of buidling a simple webpage which would be used as search front-end for folks who do not have "edit" access to the Excel doc. Should be OK? Right?
|
|
|
|
|
If I recall correctly in Win7 Ole JET DB is deprecated and you should use mentioned ACE.OLEDB.12.0.
For older systems use JET. This should be installed with office and one of them should be accessible.
In my app I use web.config connection: jet for production with older version of WinServer and OLEDB for my Win7 dev machine.
I don't know if there is better way.
No more Mister Nice Guy... >: |
|
|
|
|
|
If your application running in 64 bit machine,
change the "Platform target" into X86 in project properties.
I hope it will work for you.
|
|
|
|
|
Hi All, I want to create an exam program consisting of questions and bunch of groupboxes each containing several radio buttons. Each question has a groupbox below it. The questions and their corresponding possible answers are stored on a database which will be bound to the the radio buttons at runtime. To answer an exam question, test takers will click on the radio button next to the correct answer. I would like to give each test taker a different test by rearrange the test questions by randomly changing the order of the questions and randomly changing the order of the possible answers. Randomizing the order of the questions is pretty straight forward using the Random Class to randomly display the questions but I don't know how to randomly bind data from the database to the radio buttons in the groupboxes. Please explain how this can be done or point me to a site where there's a tutorial on doing this if you know of one. Thanks in advance.
modified 6-Oct-12 11:42am.
|
|
|
|
|
Hi Dear,
I have worked on this type of project...
The following is the stored procedure you can use for randomly getting the questions as well as the random options (answers) from the database.
This stored procedure covers almost your 80% of the work, only the thing is you have to bind it to the gridview . If you have any doubts in this you can comment.
//////////////////////////////////////////////////////////////////////////////////////
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER
Procedure [dbo].[GetRandomOptionsold]
(@class varchar(max),
@Subject varchar(max),
@ExamType varchar(max),
@School varchar(max)
)
as
Begin
Create
Table #Options(ID int identity(1,1),Fields nvarchar(10))
Insert
into #Options
Select
COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS Where TABLE_NAME='Questions' And COLUMN_NAME like 'O%' Order By NEWID()
Declare
@RandomCols nvarchar(100)
Set
@RandomCols=''
Select
@RandomCols=@RandomCols+Fields+' ,' from #Options
Set
@RandomCols=(Select REPLACE(Substring(@RandomCols,0,CHARINDEX(' ,',@RandomCols)+2),' ,',' as O1,')
+
SUBSTRING(@RandomCols,CHARINDEX(' ,',@RandomCols)+2,LEN(@RandomCols)))
Set
@RandomCols=(Select REPLACE(Substring(@RandomCols,0,CHARINDEX(' ,',@RandomCols)+2),' ,',' as O2,')
+
SUBSTRING(@RandomCols,CHARINDEX(' ,',@RandomCols)+2,LEN(@RandomCols)))
Set
@RandomCols=(Select REPLACE(Substring(@RandomCols,0,CHARINDEX(' ,',@RandomCols)+2),' ,',' as O3,')
+
SUBSTRING(@RandomCols,CHARINDEX(' ,',@RandomCols)+2,LEN(@RandomCols)))
Set
@RandomCols=(Select REPLACE(Substring(@RandomCols,0,CHARINDEX(' ,',@RandomCols)+2),' ,',' as O4,')
+
SUBSTRING(@RandomCols,CHARINDEX(' ,',@RandomCols)+2,LEN(@RandomCols)))
Declare
@strQry nvarchar(MAX)
Set
@strQry=''
Set
@strQry='Select qno,que,'+@RandomCols+'ans from Questions where Class='''+@Class+''' and Subject='''+@Subject+''' and ExamType='''+@ExamType+''' and School='''+@School+''''
exec
(@strQry)
End
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
If it has not solved your problem , please let me know ...
|
|
|
|
|
I have the following code and SQL:
sql_connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["SQLdb"].ConnectionString);
sql_connection.Open();
sql_command = new MySqlCommand("sp_delete_channel", sql_connection);
sql_command.CommandType = CommandType.StoredProcedure;
sql_command.Parameters.AddWithValue("param_channel_id", channel_id).MySqlDbType = MySqlDbType.Int32;
sql_command.Parameters.AddWithValue("param_volow_member_id", Convert.ToInt32(Session["volow_member_id"])).MySqlDbType = MySqlDbType.Int32;
sql_command.Parameters.Add("param_is_channel_created", MySqlDbType.Bit).Direction = ParameterDirection.Output;
int result_rows = sql_command.ExecuteNonQuery();
if (Convert.ToBoolean(sql_command.Parameters["param_is_channel_created"].Value) != true)
{ Session["is_channel_created"] = false; }
and this is MySQL stored procedure:
BEGIN
SET param_is_channel_created = TRUE;
DELETE FROM member_posts WHERE member_channel_id = param_channel_id;
DELETE FROM member_channels WHERE member_channel_id = param_channel_id;
IF NOT EXISTS (SELECT member_channel_id FROM member_channels WHERE volow_member_id = param_volow_member_id) THEN
BEGIN
UPDATE volow_members SET is_channel_created = FALSE;
SET param_is_channel_created = FALSE;
END;
END IF;
END
but nothing is happending and I am sure all are ok because I change something in the storedprocedure and I got and error but with the above I don''t get any error and page is just reloading with the same data when I click the delete button?
Kindly help...
|
|
|
|
|