Ehr Problems and Solutions

Source: Internet
Author: User

1. The downloaded file in the modal dialog box is dead.

Solution: add the following code to the page (many functions are disabled in the modal dialog box)
<Base target = "Download"/>
<IFRAME id = "Download" name = "Download" Height = "0px" width = "0px"> </iframe>

2. updatepanel updates the data in the background. However, after processing the data in the background, the foreground JS needs to re-calculate some values based on the Processing (for example, many rows are created in the background, the front-end generates the subscript of the control when a row needs to be dynamically added based on the returned row number)
Solution: </ASP: updatepanel> followed by a JS
<SCRIPT type = "text/JavaScript">
SYS. webforms. pagerequestmanager. getinstance (). add_endrequest (your_event); // register your event
</SCRIPT>

3. Take the Server Control client verification + pure HTML verification (self-written)
Method;
<SCRIPT type = "text/JavaScript">
Function webform_onsubmit (){
// Validatehtmlcontrol () is a self-written verification
If (typeof (validatoronsubmit) = "function "){
If (validatoronsubmit () = false | validatehtmlcontrol () = false ){
Return false;
}
Return true;
}
}
</SCRIPT>
Later I encountered an issue where approved was not verified. Later I found that it should be the validatoronsubmit () Problem (problem function, tile wipe). I should use page_clientvalidate ("verify group "), however, page_clientvalidate will be verified during asynchronous sending back, so an event is added for judgment (in webform_onsubmit, if it is not a submit, the event cannot be obtained, which is null)
Later, this method was rewritten
Function webform_onsubmit (){
If (typeof (validatoronsubmit) = "function "){
VaR vtag = 0;
// If (validatoronsubmit () = true) {// This method has a problem
// Vtag ++;
//}
If (event! = NULL ){
If (event. srcelement. causesvalidation = "true" | event. srcelement. getattribute ("causesvalidation") = "true "){
If (typeof (page_clientvalidate) = "function "){
If (page_clientvalidate ("validatesubmit") = true ){
Vtag ++;
}
}
If (validatehtmlcontrol () = true ){
Vtag ++;
}
If (vtag = 2 ){
Return true;
}
Return false;
}
Else {
Return true;
}
}
Else {
Return true;
}
}
}
</SCRIPT>

 

 

4. Try to bind data to the data source at a time. Do not query the database in itemdatabound.
5. Join (select * from t where a <> '')
>
Join t on... and T. A <>''
6. oledb cannot be read using the sheet name, because when the column type is mixed, the value (null) is not obtained for the column type (Excel selects the most data type from the first eight rows ).
The so-called solutions on the Internet are all nonsense http://hi.baidu.com/%CD%F5%BD%F0%BB%A220080111/blog/item/1b4308126e91e3d5c3fd78b8.html

7. An egg problem: modifying the word "Browse" in the file control will affect the Excel upload
<% -- <Input type = "file" runat = "server" id = "fileupload1" style = "display: none" Title = "Browse" onpropertychange = "txtfilepath. value = This. value; "/> -- %>
<% -- <Input type = "text" readonly = "readonly" id = "txtfilepath" style = "width: 220px;"/>
<Input type = "button" id = "btntemp" onclick = "document. getelementbyid ('<% = fileupload1.clientid %> '). click () "value =" Browse "/> -- %>
<% -- <Asp: button id = "btnbrowse" runat = "server" skinid = "normalbtn" text = "Browse"
Onclientclick = "tempbutton ()"/> -- %>

8. How can updatepanel be dynamically integrated with pure HTML,
Use another updatepanel package to package the part that does not need to be sent back.
Updatemode = "Conditional", and then set
<Triggers>
<Asp: asyncpostbacktrigger controlid = "_ UPI"/>
</Triggers>
In this way, it is only affected by this control.


9,. savehistory {behavior: URL (# default # savehistory );}
A control sets this class attribute, and the page refresh also saves the value.

10. solution after the table is locked


-- Query the locked ID
Select request_session_id as spid, object_name (resource_associated_entity_id) as tablename
From SYS. dm_tran_locks
Where resource_type = 'object'


-- Assign the ID found above to the spid below
Declare @ spid int
Set @ spid = 52
Declare @ SQL varchar (1000)
Set @ SQL = 'Kill '+ Cast (@ spid as varchar)
Exec (@ SQL)


11. view the table information (field type, length, primary key, null, description)


Declare @ table_name as varchar (max)
Set @ table_name = 'salesportal _ report_precontract'
Select * from (

Select Sys. Columns. column_id, SYS. Columns. Name, SYS. types. Name as typename, SYS. Columns. max_length, SYS. Columns. is_nullable,
(Select count (*) from SYS. identity_columns where SYS. identity_columns.object_id = SYS. Columns. object_id and SYS. Columns. column_id = SYS. identity_columns.column_id) as is_identity,
(Select value from SYS. extended_properties where SYS. extended_properties.major_id = SYS. Columns. object_id and SYS. extended_properties.minor_id = SYS. Columns. column_id) as description
From sys. columns, sys. tables, sys. types where sys. columns. object_id = sys. tables. object_id and SYS. columns. system_type_id = sys. types. system_type_id and [email protected] _ name -- order by sys. columns. column_id
) A where a. typename <> 'sysname' order by column_id

12. An interesting little thing:
Lable on the server side, set the text attribute, and between "<> </>, you can also add <font color = "red"> <B> * </B> </font>

13 An error occurred while downloading the button in updatepanel. "This operation cannot be completed due to the c00ce514 error"
Solution: the button is changed to the trigger of PostBack.
Cause: the value of resposetext returned by asynchronous sending is too large, and it is estimated that it is not recognized


14. SQL Optimization

Select
Stuff (select ',' + cilaccount from payroll_securitycode for XML Path (''), 1, 1 ,'')

Select stuff ('abcdef', 2, 3, 'ijklmn ')


15

Public static void setvalue_ddl (system. Web. UI. webcontrols. dropdownlist ddlist, object value)
{
If (value! = NULL)
{
If (ddlist. Items. findbyvalue (value. tostring ())! = NULL)
{
Ddlist. selectedvalue = value. tostring ();
}
Else
{
Ddlist. selectedindex =-1;
}
}
Else
{
Ddlist. selectedindex =-1;
}
}

Ehr Problems and Solutions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.